Get DIDs API

The Get DIDs API is a web service that orders new telephone numbers (DIDs) in the area code you choose. The API returns the new numbers as CSV.

This API requires an API key. Find your key on the Organization settings page of the Smart Carrier dashboard. If you cannot find it, contact support@smartcarrier.io.

Web service information

FieldValue
Endpointhttps://api.smartcarrier.io/v2/get-dids?
MethodGET
ParametersareaCode, quantity, routing_container, cluster_id (optional)
Headerx-api-key (get your API key)
Examplehttps://api.smartcarrier.io/v2/get-dids?areaCode=512&quantity=5&routing_container=ROUTING_CONTAINER

Request parameters

ParameterTypeRequiredDescription
areaCodestringYesThe 3-digit area code to get numbers in. For example, 512.
quantityintegerYesHow many numbers to get.
routing_containerstringYesThe routing container to assign the new numbers to.
cluster_idstringNoThe ID of a dedicated repository. If you set it, the API adds the new numbers to that repository.

cURL example

curl --location 'https://api.smartcarrier.io/v2/get-dids?areaCode=512&quantity=5&routing_container=ROUTING_CONTAINER' \
--header 'x-api-key: YOUR_API_KEY'

To add the numbers to a dedicated repository, add cluster_id to the URL:

curl --location 'https://api.smartcarrier.io/v2/get-dids?areaCode=512&quantity=5&routing_container=ROUTING_CONTAINER&cluster_id=CLUSTER_ID' \
--header 'x-api-key: YOUR_API_KEY'

Replace YOUR_API_KEY with your API key, ROUTING_CONTAINER with your routing container, and CLUSTER_ID with the ID of your dedicated repository.

Sample response

15125550101,15125550102,15125550103,15125550104,15125550105

What does the API return?

The API returns the new telephone numbers as CSV (comma-separated values). Split the response on , to get each number.