NAME

Twilio::Rest::Notify::V1::Service::Binding - The Binding resource

SYNOPSIS

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

my $binding = $client->notify->v1->services($service_sid)->bindings->create($identity, $binding_type, $address, \%options);
for my $binding ($client->notify->v1->services($service_sid)->bindings->read({}, 20)) {
  ...
}
my $binding = $client->notify->v1->services($service_sid)->bindings($sid)->fetch;
$client->notify->v1->services($service_sid)->bindings($sid)->delete;

DESCRIPTION

This file holds BindingList, BindingPage, BindingContext and BindingInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

BindingList

Returned by $client->notify->v1->services($service_sid)->bindings. See also Twilio::ListResource.

create

my $binding = $client->notify->v1->services($service_sid)->bindings->create($identity, $binding_type, $address, \%options);

Returns a BindingInstance.

The required values are:

$identity

The identity value that uniquely identifies the new resource's User within the Service. Up to 20 Bindings can be created for the same Identity in a given Service.

$binding_type

One of apn, gcm, sms, fcm, facebook-messenger or alexa.

$address

The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format.

The options are:

credential_sid

The SID of the Credential resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only apn, fcm, and gcm type Bindings.

endpoint

Deprecated.

notification_protocol_version

The protocol version to use to send the notification. This defaults to the value of default_xxxx_notification_protocol_version for the protocol in the Service. The current version is "3" for apn, fcm, and gcm type Bindings. The parameter is not applicable to sms and facebook-messenger type Bindings as the data format is fixed.

tag

A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. An array reference.

read

my @records = $client->notify->v1->services($service_sid)->bindings->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

The options are:

end_date

Only include usage that occurred on or before this date. Specify the date in GMT and format as YYYY-MM-DD. A string, or an object with an epoch method. See "iso8601_date_time" in Twilio::Serialize.

identity

The User's identity value of the resources to read. An array reference.

start_date

Only include usage that has occurred on or after this date. Specify the date in GMT and format as YYYY-MM-DD. A string, or an object with an epoch method. See "iso8601_date_time" in Twilio::Serialize.

tag

Only list Bindings that have all of the specified Tags. The following implicit tags are available: all, apn, fcm, gcm, sms, facebook-messenger. Up to 5 tags are allowed. An array reference.

stream

my $stream = $client->notify->v1->services($service_sid)->bindings->stream(\%options, $limit, $page_size);

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

page

my $page = $client->notify->v1->services($service_sid)->bindings->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->notify->v1->services($service_sid)->bindings->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->notify->v1->services($service_sid)->bindings->get_context($sid);

Returns a BindingContext, and makes no request.

BindingPage

A Twilio::Page of BindingInstance objects.

records_key

build_instance

Used by Twilio::Page.

BindingContext

Returned by $client->notify->v1->services($service_sid)->bindings($sid). It makes no request until one of these methods is called.

fetch

my $binding = $client->notify->v1->services($service_sid)->bindings($sid)->fetch;

Returns a BindingInstance.

delete

$client->notify->v1->services($service_sid)->bindings($sid)->delete;

Returns true.

BindingInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created the Binding resource.

address

The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format.

binding_type

The transport technology to use for the Binding. Can be: apn, fcm, gcm, sms, or facebook-messenger.

credential_sid

The SID of the Credential resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applicable only to apn, fcm, and gcm type Bindings.

date_created

The date and time in GMT when the 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 when the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

endpoint

Deprecated.

identity

The identity value that uniquely identifies the resource's User within the Service. Up to 20 Bindings can be created for the same Identity in a given Service.

The URLs of related resources.

notification_protocol_version

The protocol version to use to send the notification. This defaults to the value of default_xxxx_notification_protocol_version in the Service for the protocol. The current version is "3" for apn, fcm, and gcm type Bindings. The parameter is not applicable to sms and facebook-messenger type Bindings as the data format is fixed.

service_sid

The SID of the Service the resource is associated with.

sid

The unique string that we created to identify the Binding resource.

tags

The list of tags associated with this Binding. Tags can be used to select the Bindings to use when sending a notification. Maximum 20 tags are allowed.

url

The absolute URL of the Binding resource.

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.