Host a phone number's capability on Twilio's platform.
Host a phone number's capability on Twilio's platform.
Body
-
The number to host in +E.164 format
-
Used to specify that the SMS capability will be hosted on Twilio's platform.
-
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.
Minimum length is
34, maximum length is34. Format should match the following pattern:^AC[0-9a-fA-F]{32}$. -
A 64 character string that is a human readable text that describes this resource.
-
Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
-
Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to.
-
The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource.
-
The HTTP method that should be used to request the SmsUrl. Must be either
GETorPOST. This will be copied onto the IncomingPhoneNumber resource.Values are
GETorPOST. -
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.
-
The HTTP method that should be used to request the SmsFallbackUrl. Must be either
GETorPOST. This will be copied onto the IncomingPhoneNumber resource.Values are
GETorPOST. -
Optional. The Status Callback URL attached to the IncomingPhoneNumber resource.
-
Optional. The Status Callback Method attached to the IncomingPhoneNumber resource.
Values are
GETorPOST. -
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.Minimum length is
34, maximum length is34. Format should match the following pattern:^AP[0-9a-fA-F]{32}$. -
Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
Minimum length is
34, maximum length is34. Format should match the following pattern:^AD[0-9a-fA-F]{32}$. -
Optional. Email of the owner of this phone number that is being hosted.
-
The type of ownership verification required to move the number to a
verifiedstate. The verification methods arephone-callorphone-bill.Values are
phone-callorphone-bill. -
Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill.
Minimum length is
34, maximum length is34. Format should match the following pattern:^RI[0-9a-fA-F]{32}$.
curl \
--request POST 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Email=test%40twilio.com&AddressSid=AD11111111111111111111111111111111&PhoneNumber=%2B14153608311&SmsCapability=true'
{"Email" => "test@twilio.com", "AddressSid" => "AD11111111111111111111111111111111", "PhoneNumber" => "+14153608311", "SmsCapability" => true}
{"PhoneNumber" => "+14153608311", "SmsCapability" => true}
{"PhoneNumber" => "+14153608311", "SmsCapability" => true, "VerificationType" => "phone-bill", "VerificationDocumentSid" => "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"email": "test@twilio.com",
"status": "received",
"cc_emails": [],
"extension": null,
"call_delay": 0,
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"address_sid": "AD11111111111111111111111111111111",
"unique_name": null,
"capabilities": {
"sms": true,
"voice": false
},
"date_created": "2017-03-28T20:06:39Z",
"date_updated": "2017-03-28T20:06:39Z",
"phone_number": "+14153608311",
"friendly_name": null,
"failure_reason": "",
"verification_code": null,
"verification_type": "phone-call",
"signing_document_sid": null,
"verification_attempts": 0,
"verification_call_sids": null,
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
"verification_document_sid": null
}
{
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"email": null,
"status": "received",
"cc_emails": [],
"extension": null,
"call_delay": 0,
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"address_sid": null,
"unique_name": null,
"capabilities": {
"sms": true,
"voice": false
},
"date_created": "2017-03-28T20:06:39Z",
"date_updated": "2017-03-28T20:06:39Z",
"phone_number": "+14153608311",
"friendly_name": null,
"failure_reason": "",
"verification_code": null,
"verification_type": "phone-call",
"signing_document_sid": null,
"verification_attempts": 0,
"verification_call_sids": null,
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
"verification_document_sid": null
}
{
"sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"email": null,
"status": "received",
"cc_emails": [],
"extension": null,
"call_delay": 0,
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"address_sid": null,
"unique_name": null,
"capabilities": {
"sms": true,
"voice": false
},
"date_created": "2017-03-28T20:06:39Z",
"date_updated": "2017-03-28T20:06:39Z",
"phone_number": "+14153608311",
"friendly_name": null,
"failure_reason": "",
"verification_code": null,
"verification_type": "phone-bill",
"signing_document_sid": null,
"verification_attempts": 0,
"verification_call_sids": null,
"incoming_phone_number_sid": "PN11111111111111111111111111111111",
"verification_document_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}