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

    subAccountId stringrequired

    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

    destinationstringrequired

    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}$

    countrystring

    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

    sourcestring

    Source number (SenderId) - "From:" field for the SMS

    Possible values: <= 16 characters

    clientMessageIdstring

    Client managed id for the message : your own unique reference

    Possible values: <= 350 characters

    textstringrequired

    Message body - the text of the message

    encodingstring

    Encoding for the text of the message

    Possible values: [AUTO, GSM7, UCS2]

    Default value: AUTO
    scheduledstring<date-time>

    Date and time when a schedule delivery of the message must happen

    expirystring<date-time>

    Date and time after which a message cannot be sent

    dlrCallbackUrlstring<uri>

    Webhook URL where delivery status for the SMS will be posted (Overwrites your default account callback URL).

    clientIpstring

    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.

    trackstring

    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]

    Default value: null

Schema

    umidstringrequired

    Unique message id (guid) generated by 8x8 SMS platform upon message submission

    destinationstringrequired

    Mobile phone number (MSISDN) to which the SMS was sent

    Possible values: Value must match regular expression ^\+?\d{7,15}$

    status objectrequired

    codestringrequired

    Code for the SMS delivery status.

    Possible values: [QUEUED, REJECTED]

    descriptionstringrequired

    Explanation for code.

    encodingstringrequired

    Detected message encoding. Useful when sending initial request with encoding=AUTO

    Possible values: [AUTO, GSM7, UCS2]

    clientMessageIdstring

    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

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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

    Upgrade
    Example: TLS/1.3

Schema

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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

    codeintegerrequired

    Error code

    messagestring

    Error description

    errorIdstring<uuid>required

    Unique id of error. You can use it as reference when sending enquiries to 8x8 support

    timestampstring<date-time>required

    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.

Was this article helpful?
or
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.

Didn't find what you were looking for?

Submit a request