Java SDK
I. Preparation
1) Obtain SDK Key Information
- Obtain the SDK key information, which includes the PublicKey and PrivateKey. You can get these from API Product/API Key . For detailed steps, refer to: How to obtain Public and Private Keys.
2) Obtain Project ID
- This refers to the project ID of the current project in use under the current account. You can access the project ID from Resource Statistics . For detailed steps, refer to: How to obtain Project ID.
3) Apply for SMS Signature
- International SMS: The SMS signature can be left blank for international SMS.
4) Apply for SMS Template
- International SMS: You can apply for an SMS template independently 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 SDK
1) Install SDK
Refer to the Surfercloud SDK Quick Start for installing the SDK.
2) Parameter Description
- Phone Number List (PhoneNumbers): Supports both international SMS. For international SMS, use the format
(86)13812345678, where the international dialing code is prefixed to the phone number. - SMS Template ID (TemplateId): First-time users need to apply for a template in the Surfercloud console. After approval, pass the template ID here.
- SMS Template Parameters (TemplateParams): Variables can be passed into the SMS template. The number of variables to be passed corresponds to the number in the template at the time of application.
- SMS Signature (SigContent): First-time users need to apply for a signature in the Surfercloud console. After approval, pass the signature here. The first applied signature is the default signature, and when there is a default signature, this parameter can be omitted.
3) Related Restrictions
-
SMS content is calculated as 1 character for each letter, Chinese character, or English punctuation mark. The length cannot exceed 600 characters.
-
The maximum number of characters for a single send is 500, where letters, Chinese characters, and English punctuation are each calculated as 1 character.
-
The SMS content should not contain special characters (you can check with the sensitive word detection tool on the SMS package page).
III. Complete Example
Please contact technical support.