API Console

Try the SMS API

You can request a trial account to try out the SMS API. Once you have a trial long code, use this API Console page to send test requests and view the responses. For more detailed information about each request and response, see the API Reference pages.

Note that many SMS API functions use callback requests to send information to your application. To take advantage of that, you’ll need to set up a resource on your server to receive those requests. See Receive SMS API Callbacks for more information, and for a simple Node.js listener that you can create for testing. After you set up a callback listener, you can use the POST /callbacks request on this page to tell ThingSpace to send SMS callbacks to your listener URL.

You will need a ThingSpace Develop account in order to get an API token that is required fot the Authorization: Bearer field, below. You’ll use the token with the API console on this page and in your application:

  • API Console: Sign in, and go to Key Management in your Account Settings, then click “Key Management.” Refresh the Token and then copy it to the clipboard. Return to the API Console page and paste it into the Authorization: Bearer field below.
  • In Your App: Follow the instructions for Obtaining a ThingSpace Token Programmatically.

NOTE: API Tokens are valid for one hour.

Where to start

Here is a suggested sequence of API requests to get you started:

  1. Set up a callback listener.
  2. Send a POST /callbacks request to register your callback listener. You can use the “Default” callbackType to receive all callback messages at a single endpoint.
  3. If you have a code to send SMS messages to Verizon phones only, your target phones need to “opt in” (consent) to receive messages from your code. From each target phone, opt-in by sending a text with the word “start” to your code. Your callback listener should receive an “opt-in” callback message for each one.
    If you have an intra-carrier code, the phones do not need to opt in. (When your application is ready to send messages to real users, you must obtain consent from users before sending them messages, regardless of which network they are on.)
  4. Use a POST /sms request to send a message to a phone. The message should be received by the phone.
  5. Wait five minutes or more, then use the messageId and transactionId from the POST /sms response in a POST /query/deliveryStatus request to check on the delivery status of the message.
Try It Out!