A short code is a 5 or 6-digit number that can send and receive SMS messages with mobile phones. These high-throughput numbers are perfect for apps that need to send SMS messages to lots of users or need to send time sensitive messages. You can buy shortcodes from Twilio or port existing short codes to our platform.
To send SMS messages from your short code, see the Sending SMS documentation.
/2008-08-01/Accounts/{AccountSid}/SMS/ShortCodes/{ShortCodeSid}
| Property | Description |
|---|---|
| Sid | A 34 character string that uniquely identifies this resource. |
| DateCreated | The date that this resource was created, given as GMT RFC 2822 format. |
| DateUpdated | The date that this resource was last updated, given as GMT RFC 2822 format. |
| FriendlyName | A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is just the short code. |
| AccountSid | The unique id of the Account that owns this short code. |
| ShortCode | The short code. e.g., 894546. |
| ApiVersion | SMSs to this short code will start a new TwiML session with this API version. |
| SmsUrl | The URL Twilio will request when receiving an incoming SMS message to this short code. |
| SmsMethod | The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST. |
| SmsFallbackUrl | The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl. |
| SmsFallbackMethod | The HTTP method Twilio will use when requesting the above URL. Either GET or POST. |
GET /2008-08-01/Accounts/ACdc5f1.../SMS/ShortCodes/SC6b20cb705c1e8f00210049b20b70fce2
<TwilioResponse>
<ShortCode>
<Sid>SC6b20cb705c1e8f00210049b20b70fce2</Sid>
<AccountSid>AC1c238e6f7a0441659833ca940b72503d</AccountSid>
<FriendlyName>67898</FriendlyName>
<ShortCode>67898</ShortCode>
<DateCreated>Sat, 09 Jul 2011 22:36:22 +0000</DateCreated>
<DateUpdated>Sat, 09 Jul 2011 22:36:22 +0000</DateUpdated>
<SmsUrl>http://smsapp.com/sms</SmsUrl>
<SmsMethod>POST</SmsMethod>
<SmsFallbackUrl>http://smsapp.com/fallback</SmsFallbackUrl>
<SmsFallbackMethod>GET</SmsFallbackMethod>
</ShortCode>
</TwilioResponse>
Tries to update the short code's properties, and returns the updated resource representation if successful. The returned response is identical to that returned above when making a GET request.
You may specify one or more of the following parameters to update this short code's respective properties:
| Parameter | Description |
|---|---|
| FriendlyName | A human readable description of the short code, with maximum length 64 characters. |
| ApiVersion | SMSs to this short code will start a new TwiML session with this API version. Either 2010-04-01 or 2008-08-01. |
| SmsUrl | The URL that Twilio should request when somebody sends an SMS to the short code. |
| SmsMethod | The HTTP method that should be used to request the SmsUrl. Either GET or POST. |
| SmsFallbackUrl | A URL that Twilio will request if an error occurs requesting or executing the TwiML at the SmsUrl. |
| SmsFallbackMethod | The HTTP method that should be used to request the SmsFallbackUrl. Either GET or POST. |
Set the SmsUrl on a short code to 'http://myapp.com/awesome'
POST /2008-08-01/Accounts/ACdc5f1.../SMS/ShortCodes/SC6b20cb705c1e8f00210049b20b70fce SmsUrl=http://myapp.com/awesome
<TwilioResponse>
<ShortCode>
<Sid>SC6b20cb705c1e8f00210049b20b70fce2</Sid>
<AccountSid>AC1c238e6f7a0441659833ca940b72503d</AccountSid>
<FriendlyName>67898</FriendlyName>
<ShortCode>67898</ShortCode>
<DateCreated>Sat, 09 Jul 2011 22:36:22 +0000</DateCreated>
<DateUpdated>Wed, 13 Jul 2011 02:07:05 +0000</DateUpdated>
<SmsUrl>http://myapp.com/awesome</SmsUrl>
<SmsMethod>POST</SmsMethod>
<SmsFallbackUrl>http://smsapp.com/fallback</SmsFallbackUrl>
<SmsFallbackMethod>GET</SmsFallbackMethod>
</ShortCode>
</TwilioResponse>
Not supported.
Not supported.
/2008-08-01/Accounts/{AccountSid}/SMS/ShortCodes
Returns a list of short code resource representations, each representing a short code within your account. The list includes paging information.
The following query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:
| Parameter | Description |
|---|---|
| ShortCode | Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. |
| FriendlyName | Only show the ShortCode resources with friendly names that exactly match this name. |
GET /2008-08-01/Accounts/ACdc5f1.../SMS/ShortCodes
<TwilioResponse>
<ShortCodes page="0" numpages="1" pagesize="50" total="10" start="0" end="9">
<ShortCode>
<Sid>SC6b20cb705c1e8f00210049b20b70fce2</Sid>
<AccountSid>AC1c238e6f7a0441659833ca940b72503d</AccountSid>
<FriendlyName>67898</FriendlyName>
<ShortCode>67898</ShortCode>
<DateCreated>Sat, 09 Jul 2011 22:36:22 +0000</DateCreated>
<DateUpdated>Wed, 13 Jul 2011 02:07:05 +0000</DateUpdated>
<SmsUrl>http://myapp.com/awesome</SmsUrl>
<SmsMethod>POST</SmsMethod>
<SmsFallbackUrl>http://smsapp.com/fallback</SmsFallbackUrl>
<SmsFallbackMethod>GET</SmsFallbackMethod>
</ShortCode>
...
</ShortCodes>
</TwilioResponse>
Return the set of short codes that match exactly 67898.
GET /2008-08-01/Accounts/ACdc5f1.../SMS/ShortCodes?ShortCode=67898
Return the set of all phone numbers containing the digits 867.
GET /2008-08-01/Accounts/ACdc5f1.../SMS/ShortCodes?ShortCode=898
Not supported.
Not supported.
Not supported.