Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Programmable Wireless: Send machine-to-machine SMS Commands

You've got a Programmable Wireless SIM in your device and you want to send a machine-to-machine command.

You can read details about the Commands resource in REST API: Commands.

How are Commands different than Programmable SMS?

Programmable SMS is used to exchange text messages between people, while Commands use SMS as the means to deliver machine-to-machine messages.

You use the Commands resource to send a text message ONLY to a Twilio SIM, not to a person's phone number. On the other hand, Commands supports some features that are only really useful for machine-to-machine workflows such as binary message encoding.

Send your first Command from your device

You want to send a Command from your device to Twilio's servers to either:

How you send a Command is largely dependent on the type of device you use to send a text message. Generally, you need to do the following:

  1. Insert a Twilio Programmable Wireless SIM in the device.
  2. Make sure your SIM is registered to your account and in the Ready or Active status.
  3. Send an SMS (text message) to the short code 2936.

What is this 2936 number?

The 2936 number is a special reserved short code used to exchange Commands with your Twilio SIMs.

You don’t yet have a phone number associated with your SIM, so how does Programmable Wireless know what device sent that Command? Each SIM has a unique identifier associated with it. Programmable Wireless uses that unique identifier to send Commands through your account.

Verify the machine received the Command

  1. Navigate to the SIMs section of the Console.
  2. Click on the SIM that is in your phone from the list of SIMs on your account.
  3. Click on the Commands tab at the top of the SIM details.

You should see your first Command sent from a machine to a machine!

What's my phone number? How can I send a Command to my device?

You may have noticed that you didn't use a phone number to send a message to your SIM. With Commands, you don't need a phone number.

Send Commands to your SIM via the API

Postman is an easy to use HTTP request tool you can use to send Commands. Follow the steps in the Postman Programmable Wireless Collection (GitHub) to send Commands and take advantage of other available HTTP requests.

You will need your SIM's Sim Sid to send a machine-to-machine message directly to the SIM.

After following these steps, you should see the JSON results of the POST displayed.

Wireless Postman Command

How to use the Postman collection and the Programmable Wireless APIs

Follow the instruction in the Postman Programmable Wireless collection to install Postman and the Programmable Wireless collection. To send a Command to your SIM:

  1. Select Create Command (Text) from the Programmable Wireless collection.
  2. Select the Body tab.
  3. Replace YOUR_SIM_SID_HERE with your Sim Sid.
  4. Enter the value of the Command that you want to send. This can be any plain text value.
  5. Click the blue Send button

That's it! You can click on your Sim SID (or Unique Name) in the Console and go to the Commands tab to see the Status of your Command.

You should now receive the Command from the 2936 number on your device.

Jon Davis Glenn Lea Evan Cummack
Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.