Programmable Chat Binding Resource
A Binding resource of Programmable Chat represents a push notification subscription for a User within their Service instance. Bindings are unique per service instance, user identity, device, and notification channel (such as APNS, GCM, FCM).
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
Each Binding resource contains these properties.
Resource properties
sid
type: SID<BS>
The unique string that we created to identify the Binding resource.
date_created
type: string<date-time>
date_updated
type: string<date-time>
endpoint
type: string
The unique endpoint identifier for the Binding. The format of this value depends on the binding_type
.
credential_sid
type: SID<CR>
binding_type
type: enum<string>
Possible values:
gcm
apn
fcm
message_types
type: array[string]
url
type: string<uri>
The absolute URL of the Binding resource.
links
type: object<uri-map>
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Bindings/{Sid}
URI parameters
Sid
type: SID<BS>
The SID of the Binding resource to fetch.
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(binding => console.log(binding.sid));
_21 "sid": "BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21 "date_created": "2016-10-21T11:37:03Z",
_21 "date_updated": "2016-10-21T11:37:03Z",
_21 "endpoint": "TestUser-endpoint",
_21 "identity": "TestUser",
_21 "binding_type": "gcm",
_21 "credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21 "removed_from_channel",
_21 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings/BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21 "user": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/TestUser"
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Bindings
URI parameters
BindingType
type: array[string]
Possible values:
gcm
apn
fcm
Identity
type: array[string]
PageSize
type: integer
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Page
type: integer
The page index. This value is simply for client state.
PageToken
type: string
The page token. This is provided by the API.
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(bindings => bindings.forEach(b => console.log(b.sid)));
_34 "first_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings?PageSize=50&Page=0",
_34 "previous_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings?PageSize=50&Page=0",
_34 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings?PageSize=50&Page=0",
_34 "next_page_url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings?PageSize=50&Page=1",
_34 "sid": "BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_34 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_34 "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_34 "date_created": "2016-10-21T11:37:03Z",
_34 "date_updated": "2016-10-21T11:37:03Z",
_34 "endpoint": "TestUser-endpoint",
_34 "identity": "TestUser",
_34 "binding_type": "gcm",
_34 "credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_34 "removed_from_channel",
_34 "url": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Bindings/BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_34 "user": "https://chat.twilio.com/v2/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Users/TestUser"
DELETE https://chat.twilio.com/v2/Services/{ServiceSid}/Bindings/{Sid}
URI parameters
Sid
type: SID<BS>
The SID of the Binding resource to delete.
_10// Download the helper library from https://www.twilio.com/docs/node/install
_10// Find your Account SID and Auth Token at twilio.com/console
_10// and set the environment variables. See http://twil.io/secure
_10const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10const authToken = process.env.TWILIO_AUTH_TOKEN;
_10const client = require('twilio')(accountSid, authToken);
_10client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')