Skip to Content

Go SDK

I. Preparation

1) Obtain SDK Key Information

2) Obtain Project ID

3) Apply for SMS Signature

  • Domestic SMS: The content of domestic SMS consists of SMS signature and SMS content. You can apply for an SMS signature in the Domestic SMS/SMS Signature module of the SMS Service Console. For detailed application steps, refer to: How to Apply for SMS Signature.
  • International SMS: SMS signature can be omitted for international SMS.

4) Apply for SMS Template

  • Domestic SMS: The content of domestic SMS consists of SMS signature and SMS content. The SMS content is obtained by calling the SMS template. You can apply for an SMS template in the Domestic SMS/SMS Signature module of the SMS Service Console. For detailed application steps, refer to: How to Apply for SMS Template.
  • International SMS: You can apply for an SMS template in the International SMS/SMS Signature module of the SMS Service Console. For detailed application steps, refer to: How to Apply for SMS Template.

II. Configure the SDK

1) Install the SDK

Refer to UCloud Global SDK Quick Start to install the SDK.

2) Parameter Description

  • Phone Numbers (PhoneNumbers): Supports both international and domestic SMS. For international SMS, use the format (86)13812345678, with the international dialing code prefixed to the phone number.
  • SMS Template ID (TemplateId): First-time users need to apply for a template in the UCloud Global console, and after approval, pass the template ID here.
  • SMS Template Parameter List (TemplateParams): Variables can be passed into the SMS template. If there are several variables in the template applied, the same number must be passed in.
  • SMS Signature (SigContent): First-time users need to apply for a signature in the UCloud Global console, and after approval, pass the signature here. The first applied signature will be the default signature, and if there is a default signature, this parameter can be omitted.
  1. SMS content is calculated based on 1 character for all letters, Chinese characters, and Chinese and English punctuation marks, and the content length must not exceed 600 characters.

  2. Domestic: The maximum number of characters for a single SMS is 70. If it exceeds 70 characters, it will be counted as “one SMS for every 67 characters”.

  3. The maximum number of characters for a single send is 500. Letters, Chinese characters, Chinese, and English punctuation marks are all calculated as 1 character;

  4. SMS content must not contain special characters (you can check through the sensitive word detection tool in the SMS package page).

VI. Complete Example

Please contact technical support.

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