Skip to Content

Python SDK

1. Preparations

1) Obtain SDK Key Information

2) Obtain Project ID

3) Apply for SMS Signature

  • International SMS: International SMS does not require an SMS signature.

4) Apply for SMS Template

2. Configure the SDK

1) Install the SDK

Refer to Surfercloud SDK Quick Start to install the SDK.

2) Parameter Description

  • Phone Numbers (PhoneNumbers): Supports both international SMS. For international SMS, use the format (86)13812345678, which requires adding the international dialing code before the phone number.
  • SMS Template ID (TemplateId): When using for the first time, you need to apply for a template in the Surfercloud Console. After approval, pass the template ID here.
  • SMS Template Parameters List (TemplateParams): Variables can be passed in the SMS template. If there are several variables in the applied template, the same number needs to be passed in.
  • SMS Signature (SigContent): When using for the first time, you need to apply for a signature in the Surfercloud Console. After approval, pass the signature here. The first applied signature is the default signature. If a default signature exists, this parameter can be left blank.
  1. SMS content, whether in letters, Chinese characters, or punctuation marks in Chinese or English, is calculated as one character. The content length must not exceed 600 characters.

  2. The upper limit of SMS characters for a single send is 500 characters. Letters, Chinese characters, and punctuation marks in Chinese and English are calculated as one character each.

  3. SMS content should not contain special characters (you can enter the SMS package page and use the Sensitive Word Detection Tool to check).

3. Complete Example

Please contact technical support.

For other APIs such as Get SMS Receipt, please refer to Code Examples in UAPI.