Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Credential Resource

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.

Names in PHP format
sid
sid<CR> Not PII

The unique string that we created to identify the Credential resource.

accountSid
sid<AC> Not PII

The SID of the Account that created the Credential resource.

friendlyName
文字列 PII MTL: 120 DAYS

The string that you assigned to describe the resource.

type
enum:push_service Not PII

The type of push-notification service the credential is for. Can be: gcm, fcm, or apn.

sandbox
文字列 Not PII

[APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

url
url Not PII

The absolute URL of the Credential resource.

Create a Credential resource

post
https://chat.twilio.com/v2/Credentials
パラメーター
Names in None format
type
必須
post enum:push_service Not PII

The type of push-notification service the credential is for. Can be: gcm, fcm, or apn.

friendly_name
オプション
post 文字列 PII MTL: 120 DAYS

A descriptive string that you create to describe the new resource. It can be up to 64 characters long.

certificate
オプション
post 文字列 Not PII

[APN only] The URL encoded representation of the certificate. For example, -----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----

private_key
オプション
post 文字列 Not PII

[APN only] The URL encoded representation of the private key. For example, -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----

sandbox
オプション
post boolean Not PII

[APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

api_key
オプション
post 文字列 Not PII

[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.

secret
オプション
post 文字列 Not PII

[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging.

例 1
        
        
        
        

        Fetch a Credential resource

        GET
        https://chat.twilio.com/v2/Credentials/{Sid}
        パラメーター
        Names in None format
        sid
        必須
        GET sid<CR> Not PII

        The SID of the Credential resource to fetch.

        例 1
              
              
              
              

              Read multiple Credential resources

              GET
              https://chat.twilio.com/v2/Credentials
              例 1
                    
                    
                    
                    

                    Update a Credential resource

                    post
                    https://chat.twilio.com/v2/Credentials/{Sid}
                    パラメーター
                    Names in None format
                    sid
                    必須
                    post sid<CR> Not PII

                    The SID of the Credential resource to update.

                    friendly_name
                    オプション
                    post 文字列 PII MTL: 120 DAYS

                    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

                    certificate
                    オプション
                    post 文字列 Not PII

                    [APN only] The URL encoded representation of the certificate. For example, -----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----

                    private_key
                    オプション
                    post 文字列 Not PII

                    [APN only] The URL encoded representation of the private key. For example, -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----

                    sandbox
                    オプション
                    post boolean Not PII

                    [APN only] Whether to send the credential to sandbox APNs. Can be true to send to sandbox APNs or false to send to production.

                    api_key
                    オプション
                    post 文字列 Not PII

                    [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.

                    secret
                    オプション
                    post 文字列 Not PII

                    [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}
                          パラメーター
                          Names in None format
                          sid
                          必須
                          削除する sid<CR> Not PII

                          The SID of the Credential resource to delete.

                          例 1
                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

                                誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。