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.
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.
You want to send a Command from your device to Twilio's servers to either:
- Test Commands.
- Hit the Commands callback webhook to direct to your servers.
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:
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.
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.
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.
Follow the instruction in the Postman Programmable Wireless collection to install Postman and the Programmable Wireless collection. To send a Command to your SIM:
- Select Create Command (Text) from the Programmable Wireless collection.
- Select the Body tab.
- Replace YOUR_SIM_SID_HERE with your Sim Sid.
- Enter the value of the Command that you want to send. This can be any plain text value.
- 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.
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。