Send Transactional SMS
  • 21 Mar 2024
  • 4 Minutes to read

    Send Transactional SMS


      Article Summary

      Overview

      This API enables you to send targeted transactional SMS to your users. You can trigger these SMS messages once a user takes a specific action on your platform.

      You can use transactional SMS messages to:

      • Send a post-purchase SMS to share details about a purchase/booking,
      • Help your users reset their password if they forget it,
      • Confirm an order a user places,
      • Share delivery tracking details of a purchase (when it is shipped, on the way, and delivered) and to take many other actions.

      Use Cases

      You can send transactional SMS messages for:

      • System notifications
      • Order confirmation / information
        • Thank you for your purchase! Your order number is {orderNumber}. View more information about your order here: {Link}
        • Hey, {firstName}! Thanks for your purchase! View more information about your order ({orderNumber}) here: {Link}
      • Shipping Confirmation
        • Great news, {firstName}! Your order ({orderNumber}) has shipped and will be to you soon. Click here to view your order details: {Link}
        • Get excited! Your order ({orderNumber}) has shipped and is on its way to you. Click here to view your order details: {Link}
      • Ticket booking confirmation or cancellation
        • Hey {firstName}, order #{orderNumber} was successfully canceled. You can check the status of your order here {Link}
      • Information about shipping and delivery updates
      • Recurring billing / Payment Updates
      • Appointment confirmations
      • Welcome Messages

      Endpoint and Headers

      POST https://sms.useinsider.com/v1/send

      Headers

      HeaderSample ValueDescription
      X-INS-AUTH-KEY1a2b3c4d5e6fThis key is required to authorize your request. Refer to API Authentication Tokens to generate your token. If needed to test Transactional SMS, please request an API key from Insider team.
      Content-Typeapplication/jsonThis header specifies the media type of the resource.

      Body Parameters

      ParameterDescriptionData TypeRequired
      toPhone NumberStringYes
      contentContent of the SMSStringYes
      unique_argsUnique arguments of transactional SMS used for tracking purposesObjectNo
      callbackThe endpoint that you define to receive the webhook eventsURLYes
      settings

      For using the URL shortening and url click tracking in your messages. 

      If you do not add these parameters to the payload, the default version will not provide usage. If you do not open urlTracking and if you do not have Insider Tag integration on the related link’s webpage you will see clickthrough metric under analytic page as zero.

      {


        urlShorteningStatus: boolean,


          urlTrackingStatus: boolean


      }


      No

      Transactional SMS Sample Example

      Sample Request

      Every request made to the request endpoint requires a request body formatted in JSON and containing your sms content.

      Your title goes here
      Make sure to replace the sample values in the request header(s) and body where required before sending your request.
      curl --location 'https://sms.useinsider.com/v1/send' \
      --header 'x-ins-auth-key: INS.Abcd1234' \
      --header 'Content-Type: application/json' \
      --data '{
          "content": "This is SMS body.",
          "to": "+105555555555",
          "callback": "http://callback.url",
          "uniqueArgs": {
              "additionalProp1": "string",
              "additionalProp2": "string",
              "additionalProp3": "string"
          },
          "settings": {
              "urlShorteningDomain": "insdr.io",
              "urlShorteningStatus": true,
              "urlTrackingStatus": true
          }
      }'

      Sample Responses

      SMS Accepted

      This response indicates that your request was successfully completed.

      {
          "message": "Accepted",
          "messageId": "sms-a1234567-b123-c123-d123-e123f123456"
      }

      SMS Sent

      {
        "id": "sms-a1234567-b123-c123-d123-e123f123456",
        "uniqueArgs": {
          "additionalProp1": "string",
          "additionalProp2": "string",
          "additionalProp3": "string"
        },
        "event": "sent",
        "partCount": 1
      }

      SMS Delivered

      {
        "id": "sms-a1234567-b123-c123-d123-e123f123456",
        "uniqueArgs": {
          "additionalProp1": "string",
          "additionalProp2": "string",
          "additionalProp3": "string"
        },
        "event": "delivered"
      }

      Bulk Transactional SMS Sample Example

      Sample Request

      Every request made to the request endpoint requires a request body formatted in JSON and containing your sms content. 

      Your title goes here
      Make sure to replace the sample values in the request header(s) and body where required before sending your request.
      curl --location 'https://sms.useinsider.com/v1/sendMultipleMessage' \
      --header 'x-ins-auth-key: INS.CiZ6Tm5O0quoY3-NVrWW.nV05gwwc+WpJzRMHKoXkR6k0naiIpPD3k7vH9andVn-+wroe84' \
      --header 'Content-Type: application/json' \
      --data '{
          "messages": [
              {
                  "phoneNumber": "+905555555555",
                  "content": "This is SMS body.",
                  "callback": "http://callback.url",
                  "settings": {
                      "urlShorteningDomain": "insdr.io",
                      "urlShorteningStatus": true,
                      "urlTrackingStatus": true
                  },
                  "uniqueArgs": {
                      "additionalProp1": "string",
                      "additionalProp2": "string",
                      "additionalProp3": "string"
                  }
              },
              {
                  "phoneNumber": "90 (555) 55",
                  "content": "This is SMS body.",
                  "callback": "http://callback.url",
                  "settings": {
                      "urlShorteningDomain": "insdr.io",
                      "urlShorteningStatus": true,
                      "urlTrackingStatus": true
                  },
                  "uniqueArgs": {
                      "additionalProp1": "string",
                      "additionalProp2": "string",
                      "additionalProp3": "string"
                  }
              }
          ]
      }'

      Bulk SMS Accepted

      {
          "message": "Accepted",
          "messageIds": [
              {
                  "phoneNumber": "+905555555555",
                  "messageSid": "sms-a1234567-b123-c123-d123-e123f123456"
              }
          ],
          "errors": [
              {
                  "field": "messages[1].phoneNumber",
                  "error": "This field must be a valid phone number."
              }
          ]
      }

      Bulk SMS Sent

      {
        "id": "sms-a1234567-b123-c123-d123-e123f123456",
        "uniqueArgs": {
          "additionalProp1": "string",
          "additionalProp2": "string",
          "additionalProp3": "string"
        },
        "event": "sent",
        "partCount": 1
      }

      Bulk SMS Delivered

      {
        "id": "sms-a1234567-b123-c123-d123-e123f123456",
        "uniqueArgs": {
          "additionalProp1": "string",
          "additionalProp2": "string",
          "additionalProp3": "string"
        },
        "event": "delivered"
      }

      Limitations

      • All functions must be executed with a simple HTTPS POST request.
      • The API Key should be provided as the authorization key on the request header. If the key is incorrect, the operation will not be executed and an authorization error will return in the response.
      • Transactional API cannot be used for sending promotional SMS. It is designed to set transactional SMS only.
      • Phone number should be in E164 format.
      • Content can’t be empty. The maximum limit is 670 characters.
      • The rate limit is 5 requests per second.
      • The message limit is 100 messages per request.
      • The maximum speed will be determined based on the Provider Setup.

      Was this article helpful?


      What's Next
      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses