NAME
Twilio::Rest::Lookups::V1::PhoneNumber - The PhoneNumber resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $phone_number = $client->lookups->v1->phone_numbers($phone_number)->fetch;
DESCRIPTION
Detailed information on phone numbers
This file holds PhoneNumberList, PhoneNumberContext and PhoneNumberInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
PhoneNumberList
Returned by $client->lookups->v1->phone_numbers. See also Twilio::ListResource.
get_context
my $context = $client->lookups->v1->phone_numbers->get_context($phone_number);
Returns a PhoneNumberContext, and makes no request.
PhoneNumberContext
Returned by $client->lookups->v1->phone_numbers($phone_number). It makes no request until one of these methods is called.
fetch
my $phone_number = $client->lookups->v1->phone_numbers($phone_number)->fetch(\%options);
Fetch information about a phone number. You can use this endpoint to retrieve the carrier and caller name for a phone number, as well as any installed Add-ons. Returns a PhoneNumberInstance.
The options are:
add_ons-
The
unique_nameof an Add-on you would like to invoke. Can be theunique_nameof an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the Add-ons documentation. An array reference. add_ons_data-
Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on.
country_code-
The ISO country code of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format.
type-
The type of information to return. Can be:
carrierorcaller-name. The default is null. To retrieve both types of information, specify this parameter twice; once withcarrierand once withcaller-nameas the value. An array reference.
PhoneNumberInstance
See also Twilio::InstanceResource.
It has fetch, which work as they do on the context.
Its fields are:
- add_ons
-
A JSON string with the results of the Add-ons you specified in the
add_onsparameters. For the format of the object, see Using Add-ons. - caller_name
-
The name of the phone number's owner. If
null, that information was not available. - carrier
-
The telecom company that provides the phone number.
- country_code
-
The ISO country code for the phone number.
- national_format
-
The phone number, in national format.
- phone_number
-
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
- url
-
The absolute URL of the resource.
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.