Credential Resource
The Credential resource represents one credential record for a specific push notifications channel. Twilio Conversations supports the APNS, FCM, and GCM push notification channels. Each push notification channel vendor issues its own Credentials, and they can vary between vendors. The Credential resource allows you to save the Credentials that should be used for push notifications to a specific channel.
Credential properties
The Credential resource contains these properties:
Resource Properties in REST API format | |
---|---|
sid
|
A 34 character string that uniquely identifies this resource. |
account_sid
|
The unique ID of the Account responsible for this credential. |
friendly_name
|
The human-readable name of this credential, limited to 64 characters. Optional. |
type
|
The type of push-notification service the credential is for. Can be: |
sandbox
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
date_created
|
The date that this resource was created. |
date_updated
|
The date that this resource was last updated. |
url
|
An absolute API resource URL for this credential. |
Create a Credential resource
https://conversations.twilio.com/v1/Credentials
Parameters
Parameters in REST API format | |
---|---|
type
Required
|
The type of push-notification service the credential is for. Can be: |
friendly_name
Optional
|
A descriptive string that you create to describe the new resource. It can be up to 64 characters long. |
certificate
Optional
|
[APN only] The URL encoded representation of the certificate. For example,
|
private_key
Optional
|
[APN only] The URL encoded representation of the private key. For example,
|
sandbox
Optional
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
Optional
|
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. |
secret
Optional
|
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging. |
Example 1
Fetch a Credential resource
https://conversations.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this resource. |
Example 1
Read multiple Credential resources
https://conversations.twilio.com/v1/Credentials
Example 1
Update a Credential resource
https://conversations.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this resource. |
type
Optional
|
The type of push-notification service the credential is for. Can be: |
friendly_name
Optional
|
A descriptive string that you create to describe the new resource. It can be up to 64 characters long. |
certificate
Optional
|
[APN only] The URL encoded representation of the certificate. For example,
|
private_key
Optional
|
[APN only] The URL encoded representation of the private key. For example,
|
sandbox
Optional
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
Optional
|
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. |
secret
Optional
|
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging. |
Example 1
Delete a Credential resource
https://conversations.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this resource. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.