NAME
Twilio::Rest::Numbers::V2::HostedNumberOrder - The HostedNumberOrder resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $hosted_number_order = $client->numbers->v2->hosted_number_orders->create($phone_number, $contact_phone_number, $address_sid, $email, \%options);
for my $hosted_number_order ($client->numbers->v2->hosted_number_orders->read({}, 20)) {
...
}
my $hosted_number_order = $client->numbers->v2->hosted_number_orders($sid)->fetch;
$client->numbers->v2->hosted_number_orders($sid)->update($status, \%options);
$client->numbers->v2->hosted_number_orders($sid)->delete;
DESCRIPTION
This file holds HostedNumberOrderList, HostedNumberOrderPage, HostedNumberOrderContext and HostedNumberOrderInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
HostedNumberOrderList
Returned by $client->numbers->v2->hosted_number_orders. See also Twilio::ListResource.
create
my $hosted_number_order = $client->numbers->v2->hosted_number_orders->create($phone_number, $contact_phone_number, $address_sid, $email, \%options);
Host a phone number's capability on Twilio's platform. Returns a HostedNumberOrderInstance.
The required values are:
$phone_number-
The number to host in +E.164 format
$contact_phone_number-
The contact phone number of the person authorized to sign the Authorization Document.
$address_sid-
Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
$email-
Optional. Email of the owner of this phone number that is being hosted.
The options are:
account_sid-
This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to.
cc_emails-
Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. An array reference.
contact_title-
The title of the person authorized to sign the Authorization Document for this phone number.
friendly_name-
A 128 character string that is a human readable text that describes this resource.
sms_application_sid-
Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a
SmsApplicationSidis present, Twilio will ignore all of the SMS urls above and use those set on the application. sms_capability-
Used to specify that the SMS capability will be hosted on Twilio's platform.
sms_fallback_method-
The HTTP method that should be used to request the SmsFallbackUrl. Must be either
GETorPOST. This will be copied onto the IncomingPhoneNumber resource. One ofGETorPOST. sms_fallback_url-
A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource.
sms_method-
The HTTP method that should be used to request the SmsUrl. Must be either
GETorPOST. This will be copied onto the IncomingPhoneNumber resource. One ofGETorPOST. sms_url-
The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource.
status_callback_method-
Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. One of
GETorPOST. status_callback_url-
Optional. The Status Callback URL attached to the IncomingPhoneNumber resource.
read
my @records = $client->numbers->v2->hosted_number_orders->read(\%options, $limit, $page_size);
Retrieve a list of HostedNumberOrders belonging to the account initiating the request. Returns the records as a list, fetching as many pages as it needs.
The options are:
friendly_name-
A human readable description of this resource, up to 128 characters.
incoming_phone_number_sid-
A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder.
phone_number-
An E164 formatted phone number hosted by this HostedNumberOrder.
sms_capability-
Whether the SMS capability will be hosted on our platform. Can be
trueoffalse. status-
The Status of this HostedNumberOrder. One of
received,pending-verification,verified,pending-loa,carrier-processing,testing,completed,failed, oraction-required. One oftwilio-processing,received,pending-verification,verified,pending-loa,carrier-processing,testing,completed,failedoraction-required.
stream
my $stream = $client->numbers->v2->hosted_number_orders->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->numbers->v2->hosted_number_orders->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->numbers->v2->hosted_number_orders->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->numbers->v2->hosted_number_orders->get_context($sid);
Returns a HostedNumberOrderContext, and makes no request.
HostedNumberOrderPage
A Twilio::Page of HostedNumberOrderInstance objects.
records_key
build_instance
Used by Twilio::Page.
HostedNumberOrderContext
Returned by $client->numbers->v2->hosted_number_orders($sid). It makes no request until one of these methods is called.
fetch
my $hosted_number_order = $client->numbers->v2->hosted_number_orders($sid)->fetch;
Fetch a specific HostedNumberOrder. Returns a HostedNumberOrderInstance.
update
my $hosted_number_order = $client->numbers->v2->hosted_number_orders($sid)->update($status, \%options);
Updates a specific HostedNumberOrder. Returns a HostedNumberOrderInstance.
The required values are:
$status-
One of
twilio-processing,received,pending-verification,verified,pending-loa,carrier-processing,testing,completed,failedoraction-required.
The options are:
verification_call_delay-
The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
verification_call_extension-
The numerical extension to dial when making the ownership verification call.
delete
$client->numbers->v2->hosted_number_orders($sid)->delete;
Cancel the HostedNumberOrder (only available when the status is in received). Returns true.
HostedNumberOrderInstance
See also Twilio::InstanceResource.
It has fetch, update and delete, which work as they do on the context.
Its fields are:
- account_sid
-
A 34 character string that uniquely identifies the account.
- address_sid
-
A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
- bulk_hosting_request_sid
-
A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder.
- capabilities
-
Set of booleans describing the capabilities hosted on Twilio's platform. SMS is currently only supported. A Twilio::Base::PhoneNumberCapabilities object.
- cc_emails
-
A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.
- contact_phone_number
-
The contact phone number of the person authorized to sign the Authorization Document.
- contact_title
-
The title of the person authorized to sign the Authorization Document for this phone number.
- date_created
-
The date this resource was created, given as GMT RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date that this resource was updated, given as GMT RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
-
Email of the owner of this phone number that is being hosted.
- failure_reason
-
A message that explains why a hosted_number_order went to status "action-required"
- friendly_name
-
A 128 character string that is a human-readable text that describes this resource.
- incoming_phone_number_sid
-
A 34 character string that uniquely identifies the IncomingPhoneNumber resource that represents the phone number being hosted.
- next_step
-
The next step you need to take to complete the hosted number order and request it successfully.
- phone_number
-
Phone number to be hosted. This must be in E.164 format, e.g., +16175551212
- sid
-
A 34 character string that uniquely identifies this HostedNumberOrder.
- signing_document_sid
-
A 34 character string that uniquely identifies the Authorization Document the user needs to sign.
- status
-
One of
twilio-processing,received,pending-verification,verified,pending-loa,carrier-processing,testing,completed,failedoraction-required. - url
-
The URL of this HostedNumberOrder.
- verification_attempts
-
The number of attempts made to verify ownership via a call for the hosted phone number.
- verification_call_delay
-
The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
- verification_call_extension
-
The numerical extension to dial when making the ownership verification call.
- verification_call_sids
-
The Call SIDs that identify the calls placed to verify ownership.
- verification_code
-
The digits the user must pass in the ownership verification call.
- verification_type
-
Must be
phone-call.
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.