All Products
Search
Document Center

Python

Last Updated: Mar 19, 2019

Input parameters

Name Type O/M Example Description
MessageType String Mandatory SmsReport SmsReport
QueueName String Mandatory Alicom-Queue-xxxxxx-SmsReport The name of the message queue returned from the console——System Setting.

Output parameters

Name Name Example Description
MessageId String 10080303003003 The ID generated by Alibaba Cloud to uniquely identify an SMS message.
To String 452220121 The phone number of the SMS message recipient.
Status Number 3 The status of the SMS message. Valid values: 1 (Delivered), 2 (Failed), and 3 (Submitted).
ErrorCode String success The returned error code.
ErrorDescription String success The returned error message.
SendDate String Mon, 24 Dec 2018 16:58:22 +0800 The time and date when the SMS message was sent.
ReceiveDate String Mon, 24 Dec 2018 16:58:22 +0800 The time and date when the SMS message was received.

Developer integration process

Step 1:Python version: python 2.6+, python3.x

Step 2: SDK download: Python API SDK

Step 3: Install dependency

  1. Execute in the topmost directory: python setup.py install # If python3, please execute: python3 setup.py install

  2. Go to the directory mns_python_sdk and execute: python setup.py install # If python3, please execute: python3 setup.py install

  3. Modify the information: Get ACCESS_KEY_ID and ACCESS_KEY_SECRET from the SMS console, and fill in the file const.py

  4. Run the program: python demo_sms_api.py # If python3, please execute python3 demo_sms_api.py