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
|
このリソースを一意に識別する 34 文字の文字列です。 |
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
|
このリソースの作成された日付です。 |
date_updated
|
このリソースが最後に更新された日付です。 |
url
|
An absolute API resource URL for this credential. |
Create a Credential resource
https://conversations.twilio.com/v1/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://conversations.twilio.com/v1/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
例 1
Read multiple Credential resources
https://conversations.twilio.com/v1/Credentials
例 1
Update a Credential resource
https://conversations.twilio.com/v1/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
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
Delete a Credential resource
https://conversations.twilio.com/v1/Credentials/{Sid}
パラメーター
Parameters in REST API format | |
---|---|
sid
Path
|
このリソースを一意に識別する 34 文字の文字列です。 |
例 1
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。