NAME
Twilio::Rest::Conversations::V1::Credential - The Credential resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $credential = $client->conversations->v1->credentials->create($type, \%options);
for my $credential ($client->conversations->v1->credentials->read({}, 20)) {
...
}
my $credential = $client->conversations->v1->credentials($sid)->fetch;
$client->conversations->v1->credentials($sid)->update(\%options);
$client->conversations->v1->credentials($sid)->delete;
DESCRIPTION
A Credential resource represents a push notification credential.
This file holds CredentialList, CredentialPage, CredentialContext and CredentialInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
CredentialList
Returned by $client->conversations->v1->credentials. See also Twilio::ListResource.
create
my $credential = $client->conversations->v1->credentials->create($type, \%options);
Add a new push notification credential to your account. Returns a CredentialInstance.
The required values are:
The options are:
api_key-
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
certificate-
[APN only] The URL encoded representation of the certificate. For example,
-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----. friendly_name-
A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
private_key-
[APN only] The URL encoded representation of the private key. For example,
-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----. sandbox-
[APN only] Whether to send the credential to sandbox APNs. Can be
trueto send to sandbox APNs orfalseto send to production. secret-
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging.
read
my @records = $client->conversations->v1->credentials->read(\%options, $limit, $page_size);
Retrieve a list of all push notification credentials on your account. Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->conversations->v1->credentials->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->conversations->v1->credentials->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->conversations->v1->credentials->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->conversations->v1->credentials->get_context($sid);
Returns a CredentialContext, and makes no request.
CredentialPage
A Twilio::Page of CredentialInstance objects.
records_key
build_instance
Used by Twilio::Page.
CredentialContext
Returned by $client->conversations->v1->credentials($sid). It makes no request until one of these methods is called.
fetch
my $credential = $client->conversations->v1->credentials($sid)->fetch;
Fetch a push notification credential from your account. Returns a CredentialInstance.
update
my $credential = $client->conversations->v1->credentials($sid)->update(\%options);
Update an existing push notification credential on your account. Returns a CredentialInstance.
The options are:
api_key-
[GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential.
certificate-
[APN only] The URL encoded representation of the certificate. For example,
-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----. friendly_name-
A descriptive string that you create to describe the new resource. It can be up to 64 characters long.
private_key-
[APN only] The URL encoded representation of the private key. For example,
-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----. sandbox-
[APN only] Whether to send the credential to sandbox APNs. Can be
trueto send to sandbox APNs orfalseto send to production. secret-
[FCM only] The Server key of your project from the Firebase console, found under Settings / Cloud messaging.
type-
One of
apn,gcmorfcm.
delete
$client->conversations->v1->credentials($sid)->delete;
Remove a push notification credential from your account. Returns true.
CredentialInstance
See also Twilio::InstanceResource.
It has fetch, update and delete, which work as they do on the context.
Its fields are:
- account_sid
-
The unique ID of the Account responsible for this credential.
- date_created
-
The date that this resource was created. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date that this resource was last updated. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- friendly_name
-
The human-readable name of this credential, limited to 64 characters. Optional.
- sandbox
-
[APN only] Whether to send the credential to sandbox APNs. Can be
trueto send to sandbox APNs orfalseto send to production. - sid
-
A 34 character string that uniquely identifies this resource.
- type
-
One of
apn,gcmorfcm. - url
-
An absolute API resource URL for this credential.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.