Direct SMS messaging is not available to new users. If you want to use these APIs, go to Cloud Communications > Message&SMS.
SmsPublish
Send a transactional SMS message to a specified phone number, usually used for verification code or notification.
POST /v2/{project_id}/notifications/sms
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
endpoint |
Yes |
String |
Phone number The phone number must be preceded by a plus sign (+) and a country code. |
message |
Yes |
String |
SMS message content If the content exceeds 256 bytes, the system will divide it into multiple messages, each containing 256 bytes at most and send only the first two. |
POST https://{SMN_Endpoint}/v2/{project_id}/notifications/sms { "endpoint": "+00111****1990", "message": "SMS message test" }
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Request ID, which is unique |
message_id |
String |
Message ID, which is unique |
{ "message_id": "bf94b63a5dfb475994d3ac34664e24f2", "request_id": "9974c07f6d554a6d827956acbeb4be5f" }
See section Returned Value.
See section Error Code.