Credential Resource
Programmable Chat will no longer be available or supported after July 25, 2022. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here.
If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.
A Credential resource represents one credential record for a specific push notifications channel. We support the APNS, FCM, and GCM push notification channels. Each push notification channel vendor issues its own Credentials and they can vary between vendors. This resource allows you to save the Credentials that should be used for push notifications to a specific channel.
You can learn more about provisioning vendor-specific credentials in these topics.
Twilio コンソール
You can also manage the Credentials for Programmable Chat in your Twilio console when you are logged in.
Credential properties
Each Credential resource contains these 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 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 and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
url
|
The absolute URL of the Credential resource. |
Create a Credential resource
https://chat.twilio.com/v2/Credentials
パラメーター
Parameters in REST API format | |
---|---|
type
必須
|
The type of push-notification service the credential is for. Can be: |
friendly_name
オプション
|
A descriptive string that you create to describe the new resource. It can be up to 64 characters long. |
certificate
オプション
|
[APN only] The URL encoded representation of the certificate. For example,
|
private_key
オプション
|
[APN only] The URL encoded representation of the private key. For example,
|
sandbox
オプション
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
オプション
|
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. |
secret
オプション
|
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging. |
例 1
Fetch a Credential resource
https://chat.twilio.com/v2/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Credential resource to fetch. |
例 1
Read multiple Credential resources
https://chat.twilio.com/v2/Credentials
例 1
Update a Credential resource
https://chat.twilio.com/v2/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Credential resource to update. |
friendly_name
オプション
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
certificate
オプション
|
[APN only] The URL encoded representation of the certificate. For example,
|
private_key
オプション
|
[APN only] The URL encoded representation of the private key. For example,
|
sandbox
オプション
|
[APN only] Whether to send the credential to sandbox APNs. Can be |
api_key
オプション
|
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. |
secret
オプション
|
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging. |
例 1
Delete a Credential resource
https://chat.twilio.com/v2/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Credential resource to delete. |
例 1
ヘルプが必要ですか?
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.