Phone Numbers
Introduction
In this guide, you will learn how to rent a phone number. A rentable phone number is also called a DID (Direct Inward Dialing).
There are two ways to set up a phone number:
- through CarrierX Portal via the user interface
- programmatically via the CarrierX API
Depending on your preferences you can select either of them.
Rent a Phone Number Using Portal
Let's rent a phone number through the Portal.
In the left-hand navigation menu, select CONFIGURE > Phone Numbers. Then, in the top-right corner, click the Rent New Number button.
Select a Country of your phone number. Optionally, if you would like to select a specific geography or an area code, select a State and Area Code.
Click the Search Availability button.
When the Search Availability button is clicked, the phone numbers list below will populate with numbers available for the selected state, area code and capabilities.
Select a phone number and click the Rent Number button.
The Rent Phone Number modal will appear. Check Yes, I want to rent this Phone Number and click the Rent Number button.
We have rented a phone number through the portal. In the next section, we will go over renting a phone number programmatically.
Rent a Phone Number Using REST API
In this Quick Start, we will rent a random phone number using a POST
request.
This is where you are going to need the security token you have created earlier.
To rent a phone number, send a POST
request with an empty body to the /phonenumber/dids
endpoint.
curl -X POST \
'https://api.carrierx.com/core/v2/phonenumber/dids' \
-H 'Content-Type: application/json' \
--data-binary '{}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'
The system will assign you a random available phone number (aka DID).
A successful request will return a 200
status code along with a response that looks like the following:
{
"active_capabilities": 4,
"attributes": {},
"callback_url": null,
"capabilities": 31,
"country_code": "USA",
"did_group_sid": null,
"did_sid": "f448e2c3-88c1-4cd1-8cf2-3567c16e0794",
"in_country_format": "(516) 206-5575",
"international_format": "+1 516-206-5575",
"locality": "NEW YORK",
"name": "N/A",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"phonenumber": "15162065575",
"price": "0.6",
"state": "NY",
"transformations": [],
"trunk_group_sid": null
}
Next Steps
You have rented a phone number! Now you can start making calls using your new phone number.