NAME

Twilio::Rest::Api::V2010::Account::ShortCode - The ShortCode resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

for my $short_code ($client->short_codes->read({}, 20)) {
  ...
}
my $short_code = $client->short_codes($sid)->fetch;
$client->short_codes($sid)->update(\%options);

DESCRIPTION

Messaging short codes

This file holds ShortCodeList, ShortCodePage, ShortCodeContext and ShortCodeInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ShortCodeList

Returned by $client->short_codes. See also Twilio::ListResource.

read

my @records = $client->short_codes->read(\%options, $limit, $page_size);

Retrieve a list of short-codes belonging to the account used to make the request. Returns the records as a list, fetching as many pages as it needs.

The options are:

friendly_name

The string that identifies the ShortCode resources to read.

short_code

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

stream

my $stream = $client->short_codes->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->short_codes->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->short_codes->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->short_codes->get_context($sid);

Returns a ShortCodeContext, and makes no request.

ShortCodePage

A Twilio::Page of ShortCodeInstance objects.

records_key

build_instance

Used by Twilio::Page.

ShortCodeContext

Returned by $client->short_codes($sid). It makes no request until one of these methods is called.

fetch

my $short_code = $client->short_codes($sid)->fetch;

Fetch an instance of a short code. Returns a ShortCodeInstance.

update

my $short_code = $client->short_codes($sid)->update(\%options);

Update a short code with the following parameters. Returns a ShortCodeInstance.

The options are:

api_version

The API version to use to start a new TwiML session. Can be: 2010-04-01 or 2008-08-01.

friendly_name

A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the FriendlyName is the short code.

sms_fallback_method

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

sms_fallback_url

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

sms_method

The HTTP method we should use when calling the sms_url. Can be: GET or POST. One of GET or POST.

sms_url

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

ShortCodeInstance

See also Twilio::InstanceResource.

It has fetch and update, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created this ShortCode resource.

api_version

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

date_created

The date and time in GMT that this resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date and time in GMT that this resource was last updated, specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

friendly_name

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

short_code

The short code. e.g., 894546.

sid

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

sms_fallback_method

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

sms_fallback_url

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

sms_method

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

sms_url

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

uri

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

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.