This walks through how to programmatically import Phone Numbers to your account for use with Bandwidth's Messaging Products.
Line Options feature management is NOT available for Phone numbers that have been imported for use with Hosted Messaging.
Hosted Messaging Orders in the Bandwidth Dashboard are asynchronous when creating an "order". The orders are then processed and the order status is updated asynchronously. Bandwidth recommends configuring your account with a subscription instead of polling the order resource for
Order processing times can vary and are not guaranteed, so bandwidth does not recommend setting a timeout on waiting for an order to show either
FAILED status, but instead relying on a webhook from an orders subscription.
importTnChecker endpoint validates whether or not Bandwidth can host the number for messaging. Please note that a valid response from this endpoint does not ensure that the messaging traffic will be routed to Bandwidth—there are many factors with the other carriers that could cause them to withhold messaging ownership rights on a number.
After validating the numbers are able to be imported, create a POST request to create the order to import the phone numbers in to your Bandwidth account.
|No||Internal customer order id for tracking the order. Only alphanumeric values, dashes and spaces are allowed. Max length is 40 characters.|
|Yes||Subscriber business / customer name.|
|Yes||Street address number.|
|Yes||Two letter state code.|
|Yes||First and last name of person who authorized LOA.|
|Yes||Ten digit phone number with no dots or dashes. One or more is required. Use a PhoneNumber tag for each phone number in the list.|
|Yes||See section on Sites|
|No||See section on SIP Peers|
Arequest to an existing importTnOrder will return it's status as well as any information originally used to create the order.
- ImportTnOrder Status Webhook
- Poll for ImportTnOrder Status
ImportTnOrder Status Webhook
This is a webhook that bandwidth sends to your server upon order completion/failure - there is no need to poll the resource if using this recommended method.
Poll Order Information
For completed orders, Bandwidth requires a completed Subscriber "Letter of Authorization" (LOA) from the phone number user. The LOA file is used in the case there is a dispute to ensure the phone number had permission to be enabled for hosted messaging for Bandwidth.
You are able to keep the LOA file within your own system, or upload the file to Bandwidth as part of the
A POST request to the /loas resource will upload the file. The key attribute to a successful upload is to ensure that the headers are set correctly to support the type of the file upload.