Menu

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?

Credentials Resource

The Credential resource represents one credential record for a particular push notifications channel. Currently APNS, FCM and GCM types are supported. Credentials are different per push vendor, and are issued by the vendor themselves. This resource allows you to send Twilio credentials that should be used for push notifications.

You can learn more about provisioning vendor specific credentials in these documents:

Twilio Console

You can manage the Credentials for use with Programmable Chat using your Twilio console when logged in to the console.

Properties

Each credential resource has 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

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
string 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 RFC 2822 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

url
url Not PII

The absolute URL of the Credential resource.

List All Credentials

GET /Credentials
        
        
        
        

        Create a Credential

        POST /Credentials
        

        Parameters

        Names in PHP format
        type
        Required
        post enum:push_service Not PII

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

        friendlyName
        Optional
        post string PII MTL: 120 DAYS

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

        certificate
        Optional
        post string Not PII

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

        privateKey
        Optional
        post string Not PII

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

        sandbox
        Optional
        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.

        apiKey
        Optional
        post string 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
        Optional
        post string Not PII

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

              
              
              
              

              Retrieve a Credential

              GET /Credentials/{Credential SID}
              
                    
                    
                    
                    

                    Update a Credential

                    POST /Credentials/{Credential SID}
                    

                    Parameters

                    Names in PHP format
                    sid
                    Required
                    post sid<CR> Not PII

                    The Twilio-provided string that uniquely identifies the Credential resource to update.

                    friendlyName
                    Optional
                    post string PII MTL: 120 DAYS

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

                    certificate
                    Optional
                    post string Not PII

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

                    privateKey
                    Optional
                    post string Not PII

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

                    sandbox
                    Optional
                    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.

                    apiKey
                    Optional
                    post string 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
                    Optional
                    post string Not PII

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

                          
                          
                          
                          

                          Delete a Credential

                          DELETE /Credentials/{Credential SID}
                          
                                
                                
                                
                                
                                Rate this page:

                                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.