Send SMS
POST https://sms.8x8.com/api/v1/subaccounts/:subAccountId/messages
- Sending a POST request on this endpoint allows to send SMS individually (1 request per SMS).
- It is ideal to send single personalized messages for use-cases like notifications or alerts.
URL
The 8x8 SMS subaccountid to use is defined in the URL where you send your POST request as shown below:
https://sms.8x8.com/api/v1/subaccounts/{subAccountId}/messages
You must replace
{subAccountId}in the URL above with the subaccountid that you want to use.
Request
Path Parameters
Possible values: >= 3 characters and <= 50 characters, Value must match regular expression ^[A-Za-z0-9\-._&]{3,50}$
You must replace {subAccountId} with the subaccountid that you want to use. By default this is generated once you signed up with a new account at https://connect.8x8.com.
Body
Send SMS operation body
MSISDN (destination mobile phone number). We accept both international and national formats (for national you have to specify country in the dedicated field).
Possible values: Value must match regular expression ^\+{0,1}[1-9]{1}[0-9]{6,14}$
Optional country code of Destination number(ISO 3166-1 alpha-2), if you know it. It will help to convert number from national to international format
Possible values: <= 2 characters
Source number (SenderId) - "From:" field for the SMS
Possible values: <= 16 characters
Client managed id for the message : your own unique reference
Possible values: <= 350 characters
Message body - the text of the message
Encoding for the text of the message
Possible values: [AUTO, GSM7, UCS2]
AUTO
Date and time when a schedule delivery of the message must happen
Date and time after which a message cannot be sent
Webhook URL where delivery status for the SMS will be posted (Overwrites your default account callback URL).
Fill this field to limit the number of SMS sent within a period of time based on IP address.
If the request is forwarded by one or multiple proxies, to enforce the rate limit to client IP correctly, you may want to look up the X-Forwarded-For header and retrieve the actual origin IP and assign it to this field.
You can refer to IP spoofing for more details.
Indicate whether use the sent SMS for tracking conversion rate.
Use Outcome for tracking and None for no tracking.
If no value is provided, there's no tracking unless subaccount has been configured for tracking beforehand.
The conversion rate is measured by 8x8 to monitor your application QoS.
To complete the tracking, you will also need to use Feedback API to update the sent result.
You can read here to learn more about conversion rate tracking and SMS feedback.
Possible values: [None, Outcome]
null
Schema
Unique message id (guid) generated by 8x8 SMS platform upon message submission
Mobile phone number (MSISDN) to which the SMS was sent
Possible values: Value must match regular expression ^\+?\d{7,15}$
status objectrequired
Code for the SMS delivery status.
Possible values: [QUEUED, REJECTED]
Explanation for code.
Detected message encoding. Useful when sending initial request with encoding=AUTO
Possible values: [AUTO, GSM7, UCS2]
Your custom identifier for the message
{
"umid":"bda3d56d-1424-e711-813c-06ed3428fe67",
"clientMessageId":"1234",
"destination":"6500000000",
"encoding":"GSM7",
"status":{
"code":"QUEUED",
"description":"SMS is accepted and queued for processing"
}
}
{
"umid":"bda3d56d-1424-e711-813c-06ed3428fe67",
"clientMessageId":"client-message-id",
"destination":"12025550275",
"encoding":"GSM7",
"status":{
"code":"QUEUED",
"description":"SMS is accepted and queued for processing"
}
}
Bad request error response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1002,
"message":"Invalid MSISDN format (not E.164 international number)",
"errorId":"b4478860-b76c-e811-814e-022a35cc1c71",
"timestamp":"2018-08-04T09:25:40.9235752+00:00"
}
Request was not authenticated response
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1200,
"message":"Request was not authenticated properly",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-08-02T09:42:38.8988997+00:00"
}
Upgrade Required — client is using an unsupported TLS version
Response Headers
TLS/1.3
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":1014,
"message":"TLS 1.3+ is required for Singapore-bound messages. Detected: TLSv1.2",
"errorId":"b4478860-b76c-e811-814e-022a35cc1c71",
"timestamp":"2018-08-04T09:25:40.9235752+00:00"
}
Internal server error
Schema
Error code
Error description
Unique id of error. You can use it as reference when sending enquiries to 8x8 support
Data and time of the error occurence
{
"code":1001,
"message":"Provided subAccountId doesn't belongs to your account",
"errorId":"91b106f0-c0da-4aba-a43a-7af9c5893a80",
"timestamp":"2017-04-19T02:31:19.4297387+00:00"
}
{
"code":2000,
"message":"Internal server error",
"errorId":"db9dced4-3534-4d86-9d18-6b448af0d621",
"timestamp":"2018-07-02T09:42:38.8988997+00:00"
}
Source: https://developer.8x8.com/connect/reference/send-sms-single · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments