Credential Resource
The Credential resource stores the credentials to use with a notification Binding. Credentials can be stored for APNS, FCM, and GCM 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:
Credential properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the Credential resource. |
account_sid
|
The SID of the Account that created the Credential resource. |
friendly_name
|
The string that you assigned to describe the resource. |
type
|
The Credential type. Can be: |
sandbox
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
url
|
The absolute URL of the Credential resource. |
Create a Credential resource
https://notify.twilio.com/v1/Credentials
Parameters
Parameters in REST API format | |
---|---|
type
Required
|
The Credential type. Can be: |
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
certificate
Optional
|
[APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. |
private_key
Optional
|
[APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. |
sandbox
Optional
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
Optional
|
[GCM only] The |
secret
Optional
|
[FCM only] The |
Example 1
Fetch a Credential resource
https://notify.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The Twilio-provided string that uniquely identifies the Credential resource to fetch. |
Example 1
Read multiple Credential resources
https://notify.twilio.com/v1/Credentials
Example 1
Update a Credential resource
https://notify.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The Twilio-provided string that uniquely identifies the Credential resource to update. |
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
certificate
Optional
|
[APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. |
private_key
Optional
|
[APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. |
sandbox
Optional
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
Optional
|
[GCM only] The |
secret
Optional
|
[FCM only] The |
Example 1
Delete a Credential resource
https://notify.twilio.com/v1/Credentials/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The Twilio-provided string that uniquely identifies the Credential resource to delete. |
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 browsing the Twilio tag on Stack Overflow.