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 The unique string that we created to identify the Binding resource.
date_created
type: string<DATE TIME> Not PIIdate_updated
type: string<DATE TIME> Not PIIThe unique endpoint identifier for the Binding. The format of this value depends on the binding_type
.
binding_type
type: enum<STRING> Not PIIPossible values:
gcm
apn
fcm
The absolute URL of the Binding resource.
GET https://chat.twilio.com/v2/Services/{ServiceSid}/Bindings/{Sid}
URI parameters Path Parameter
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
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.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 Query Parameter
Possible values:
gcm
apn
fcm
Query Parameter
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Query Parameter
The page index. This value is simply for client state.
Query Parameter
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
_11 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11 const authToken = process.env.TWILIO_AUTH_TOKEN;
_11 const client = require('twilio')(accountSid, authToken);
_11 client.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 Path Parameter
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
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')