Notify API Credential Resource
The Credential resource stores the credentials to use with a notification Binding . Credentials can be stored for APNS and FCM binding types.
Credential properties are specific to the binding type and provided by the vendor that supports it. Learn more about vendor-specific credentials at:
Resource properties The unique string that we created to identify the Credential resource.
The string that you assigned to describe the resource.
The Credential type. Can be: gcm
, fcm
, or apn
.
Possible values:
gcm
apn
fcm
[APN only] Whether to send the credential to sandbox APNs. Can be true
to send to sandbox APNs or false
to send to production.
date_created
type: string<DATE TIME> Not PIIdate_updated
type: string<DATE TIME> Not PIIThe absolute URL of the Credential resource.
POST https://notify.twilio.com/v1/Credentials
Request body parameters Required
The Credential type. Can be: gcm
, fcm
, or apn
.
Possible values:
gcm
apn
fcm
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
[APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. -----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----
[APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. -----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----
[APN only] Whether to send the credential to sandbox APNs. Can be true
to send to sandbox APNs or false
to send to production.
[GCM only] The Server key
of your project from Firebase console under Settings / Cloud messaging.
[FCM only] The Server key
of your project from Firebase console under Settings / Cloud messaging.
_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.notify.v1.credentials
_10 .create({type: 'gcm'})
_10 .then(credential => console.log(credential.sid));
_10 "sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "friendly_name": "Test slow create",
_10 "date_created": "2015-10-07T17:50:01Z",
_10 "date_updated": "2015-10-07T17:50:01Z",
_10 "url": "https://notify.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://notify.twilio.com/v1/Credentials/{Sid}
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the Credential resource to fetch.
_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.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .then(credential => console.log(credential.friendlyName));
_10 "sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "friendly_name": "Test slow create",
_10 "date_created": "2015-10-07T17:50:01Z",
_10 "date_updated": "2015-10-07T17:50:01Z",
_10 "url": "https://notify.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://notify.twilio.com/v1/Credentials
URI parameters 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.
_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.notify.v1.credentials
_10 .then(credentials => credentials.forEach(c => console.log(c.sid)));
_23 "sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23 "friendly_name": "Test slow create",
_23 "date_created": "2015-10-07T17:50:01Z",
_23 "date_updated": "2015-10-07T17:50:01Z",
_23 "url": "https://notify.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_23 "first_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
_23 "previous_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
_23 "url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=0",
_23 "next_page_url": "https://notify.twilio.com/v1/Credentials?PageSize=50&Page=1",
POST https://notify.twilio.com/v1/Credentials/{Sid}
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the Credential resource to update.
Request body parameters A descriptive string that you create to describe the resource. It can be up to 64 characters long.
[APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. -----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----
[APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. -----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----
[APN only] Whether to send the credential to sandbox APNs. Can be true
to send to sandbox APNs or false
to send to production.
[GCM only] The Server key
of your project from Firebase console under Settings / Cloud messaging.
[FCM only] The Server key
of your project from Firebase console under Settings / Cloud messaging.
_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.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .update({friendlyName: 'friendly_name'})
_10 .then(credential => console.log(credential.friendlyName));
_10 "sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "friendly_name": "Test slow create",
_10 "date_created": "2015-10-07T17:50:01Z",
_10 "date_updated": "2015-10-07T17:50:01Z",
_10 "url": "https://notify.twilio.com/v1/Credentials/CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
DELETE https://notify.twilio.com/v1/Credentials/{Sid}
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the Credential 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.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();