Retrieve a list of short-codes belonging to the account used to make the request

GET /2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json

Messaging short codes

Retrieve a list of short-codes belonging to the account used to make the request

Path parameters

  • AccountSid string Required

    The SID of the Account that created the ShortCode resource(s) to read.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

Query parameters

  • FriendlyName string

    The string that identifies the ShortCode resources to read.

  • ShortCode string

    Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit.

  • PageSize integer(int64)

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

  • Page integer

    The page index. This value is simply for client state.

    Minimum value is 0.

  • PageToken string

    The page token. This is provided by the API.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • short_codes array[object]
      Hide short_codes attributes Show short_codes attributes object
      • account_sid string | null

        The SID of the Account that created this ShortCode resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • api_version string | null

        The API version used to start a new TwiML session when an SMS message is sent to this short code.

      • date_created string(date-time-rfc-2822) | null

        The date and time in GMT that this resource was created specified in RFC 2822 format.

      • date_updated string(date-time-rfc-2822) | null

        The date and time in GMT that this resource was last updated, specified in RFC 2822 format.

      • friendly_name string | null

        A string that you assigned to describe this resource. By default, the FriendlyName is the short code.

      • short_code string | null

        The short code. e.g., 894546.

      • sid string | null

        The unique string that that we created to identify this ShortCode resource.

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^SC[0-9a-fA-F]{32}$.

      • sms_fallback_method string(http-method) | null

        The HTTP method we use to call the sms_fallback_url. Can be: GET or POST.

        Values are GET or POST.

      • sms_fallback_url string(uri) | null

        The URL that we call if an error occurs while retrieving or executing the TwiML from sms_url.

      • sms_method string(http-method) | null

        The HTTP method we use to call the sms_url. Can be: GET or POST.

        Values are GET or POST.

      • sms_url string(uri) | null

        The URL we call when receiving an incoming SMS message to this short code.

      • uri string | null

        The URI of this resource, relative to https://api.twilio.com.

    • end integer
    • first_page_uri string(uri)
    • next_page_uri string(uri) | null
    • page integer
    • page_size integer
    • previous_page_uri string(uri) | null
    • start integer
    • uri string(uri)
GET /2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json
curl \
 --request GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/SMS/ShortCodes.json' \
 --user "username:password"
Response examples (200)
{
  "end": 0,
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?FriendlyName=friendly_name&ShortCode=short_code&PageSize=50&Page=0",
  "page": 0,
  "start": 0,
  "page_size": 50,
  "short_codes": [
    {
      "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
      "sms_url": null,
      "short_code": "99990",
      "sms_method": "POST",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "api_version": "2010-04-01",
      "date_created": "Thu, 01 Apr 2010 00:00:00 +0000",
      "date_updated": "Thu, 01 Apr 2010 00:00:00 +0000",
      "friendly_name": "API_CLUSTER_TEST_SHORT_CODE",
      "sms_fallback_url": null,
      "sms_fallback_method": "POST"
    }
  ],
  "next_page_uri": null,
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?FriendlyName=friendly_name&ShortCode=short_code&PageSize=50&Page=0",
  "previous_page_uri": null
}
{
  "end": 0,
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?FriendlyName=friendly_name&ShortCode=short_code&PageSize=50&Page=0",
  "page": 0,
  "start": 0,
  "page_size": 50,
  "short_codes": [],
  "next_page_uri": null,
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?FriendlyName=friendly_name&ShortCode=short_code&PageSize=50&Page=0",
  "previous_page_uri": null
}