Sample - Twilio API
GET/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes/{Sid}.json

Get a short code

Retrieves a specific short code belonging to an account. Supply both resource identifiers to return the short code configuration, including its messaging URLs, methods, and metadata.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
AccountSidstringrequired
The account SID that created the short code resource. Must be a 34-character SID beginning with `AC`.
Sidstringrequired
The unique short code SID to retrieve. Must be a 34-character SID beginning with `SC`.

1 status code
200Returns the short code object with its account SID, short code value, messaging URLs and methods, fallback configuration, timestamps, and resource URI.
account_sidstringoptional
The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this ShortCode resource.
api_versionstringoptional
The API version used to start a new TwiML session when an SMS message is sent to this short code.
date_createdstringoptional
The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
date_updatedstringoptional
The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
friendly_namestringoptional
A string that you assigned to describe this resource. By default, the `FriendlyName` is the short code.
short_codestringoptional
The short code. e.g., 894546.
sidstringoptional
The unique string that that we created to identify this ShortCode resource.
sms_fallback_methodstringoptional
The HTTP method we use to call the `sms_fallback_url`. Can be: `GET` or `POST`.
Allowed:GETPOST
sms_fallback_urlstringoptional
The URL that we call if an error occurs while retrieving or executing the TwiML from `sms_url`.
sms_methodstringoptional
The HTTP method we use to call the `sms_url`. Can be: `GET` or `POST`.
Allowed:GETPOST
sms_urlstringoptional
The URL we call when receiving an incoming SMS message to this short code.
uristringoptional
The URI of this resource, relative to `https://api.twilio.com`.

Error handling

AccountSid must be a 34-character account SID beginning with AC, and Sid must be a 34-character short code SID beginning with SC. Both identifiers must identify the account and short code you want to retrieve.