NotifyBinding

Create Binding

POST
/v1/Services/{ServiceSid}/Bindings

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

ServiceSid*string

The SID of the Service to create the resource under.

Match^IS[0-9a-fA-F]{32}$
Length34 <= length <= 34

Request Body

application/x-www-form-urlencoded

Identity*string

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.

BindingType*BindingBindingType

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

Value in

  • "apn"
  • "gcm"
  • "sms"
  • "fcm"
  • "facebook-messenger"
  • "alexa"
Address*string

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.

Tag?array<string>

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.

NotificationProtocolVersion?string

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.

CredentialSid?string

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.

Match^CR[0-9a-fA-F]{32}$
Length34 <= length <= 34
Endpoint?string

Deprecated.

Response Body

application/json

curl -X POST "https://example.com/v1/Services/stringstringstringstringstringstri/Bindings" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'Address=address&BindingType=apn&CredentialSid=CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Endpoint=endpoint&Identity=24987039&NotificationProtocolVersion=notification_protocol_version&Tag=tag'
{  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "address": "a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73",  "binding_type": "apn",  "credential_sid": null,  "date_created": "2015-07-30T20:00:00Z",  "date_updated": "2015-07-30T20:00:00Z",  "endpoint": "26607274",  "identity": "24987039",  "notification_protocol_version": "3",  "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "tags": [    "26607274"  ],  "links": {    "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039"  },  "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}