Send an SMS

The fastest way to send your first SMS is to try out the SMS API Explorer. If you have your credentials, follow the instructions to use TeleSign’s SMS API for the first time. You will also be able to get a code snippet for the request in the language of your choice.

Use these instructions with the SMS API Explorer to send an SMS request and get a code snippet for making the request in the language of your choice.

  1. Open the reference page for the POST /v1/messaging endpoint.
  2. Under the AUTHENTICATION header in the right panel of the page, put your Customer ID in the username field and your API key in the password field.
  3. Go to the middle panel of the page, under FORM DATA. In the phone_number field enter the phone number you want to use to try out the Explorer.
  4. In the message field enter a test message, such as "hello world".
  5. In the message field enter a message type, such as "MKT" for a marketing message.
  6. Click Try It! in the right panel to see your transaction. You will be charged the standard rate for your transaction, and you are subject to all compliance rules as appropriate for your transaction.
  7. If you want you can also click the copy icon to the left of Try It! to copy the code snippet displayed. To change the programming language of the snippet, select one of the options under the LANGUAGE header in the right sidebar.

Congratulations! You've sent your first SMS using TeleSign's SMS API and generated your first code snippet!

SMS API Information

This section provides general information about the SMS API.

  • The URI is https://rest-api.telesign.com/v1/messaging
  • Authentication - You can authenticate with Basic or Digest authentication.
  • Use UTF-8 encoded unicode characters as inputs for all TeleSign APIs.
  • Use Content-Type application/x-www-form-urlencoded in request headers.

You can read more about parameters you can send in an SMS request on the SMS Request (POST v1/messaging) page.

Examples

You use a POST request to send your message.

Example POST Request with the SMS API:

POST https://rest-api.telesign.com/v1/messaging HTTP/1.1
Authorization: Basic 12345678-9ABC-DEF0-1234-56789ABCDEF0:vjE/ZDfPvDkuGNsuqCFFO4neYIs=
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Date: Tue, 31 Jan 2017 14:51:26 GMT
phone_number=15555551234&message=Your message here.&account_lifecycle_event=create&originating_ip=203.0.113.45

Here is an example POST response:

Example POST Response:

HTTP/1.1 200 OK
Date: Tue, 31 Jan 2017 14:51:28 GMT
Server: CERN/3.0 libwww/2.17
Content-Length: 316
Allow: GET,POST
Content-Type: application/json
{
   "external_id": "Custom external ID",
   "reference_id": "0123456789ABCDEF0123456789ABCDEF",
   "status": {
      "code": 290,
      "updated_on": "2017-31-03T14:51:28.709526Z",
      "description": "Message in progress"
   },
   "additional_info": {
      "code_entered": null,
      "message_parts_count" : 1
   }
} 

Next Steps

This section offers some suggestions for next steps to take.

Did this page help you?