ShortCode Resource
Public Beta
The Service Resource is currently available as a Public Beta product. This means that some features for configuring your Messaging Service via the REST API are not yet implemented, and others may be changed before the product is declared Generally Available. Messaging Service Configuration through the Twilio Console is Generally Available.
Public Beta products are not covered by a Twilio SLA.
The resources for sending Messages with a Messaging Service are Generally Available.
The ShortCode subresource of a Service Resource represents the short codes you have associated to the Service.
When a short code has been added to the Messaging Service, Copilot will always attempt to prioritize message delivery with your short code when possible. If the short code cannot be used to reach your user, Copilot's Shortcode Reroute will select a phone number in your Service instead.
Inbound messages received on any of short codes associated with a Messaging Service are passed to the inbound request URL of the Service with the TWiML parameters that describe the message.
ShortCode properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the ShortCode resource. |
account_sid
|
The SID of the Account that created the ShortCode resource. |
service_sid
|
The SID of the Service the resource is associated with. |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
short_code
|
The E.164 format of the short code. |
country_code
|
The 2-character ISO Country Code of the number. |
capabilities
|
An array of values that describe whether the number can receive calls or messages. Can be: |
url
|
The absolute URL of the ShortCode resource. |
Create a ShortCode resource
https://messaging.twilio.com/v1/Services/{ServiceSid}/ShortCodes
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to create the resource under. |
short_code_sid
Required
|
The SID of the ShortCode resource being added to the Service. |
Example 1
Fetch a ShortCode resource
https://messaging.twilio.com/v1/Services/{ServiceSid}/ShortCodes/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to fetch the resource from. |
sid
Path
|
The SID of the ShortCode resource to fetch. |
Example 1
Read multiple ShortCode resources
https://messaging.twilio.com/v1/Services/{ServiceSid}/ShortCodes
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to read the resources from. |
Example 1
Delete a ShortCode resource
https://messaging.twilio.com/v1/Services/{ServiceSid}/ShortCodes/{Sid}
Removing a short code from the Messaging Service does not release the short code from your account. You must cancel the short code from your Account in order to disassociate and delete the short code from your Messaging Service.
Returns a 204 NO CONTENT
if the short code was successfully removed from the service.
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to delete the resource from. |
sid
Path
|
The SID of the ShortCode resource to delete. |
Example 1
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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.