This guide describes how to check our DID availability. You should first read through the Overview to ensure you understand how to use our API.
For a list of countries where we have DIDs, use the /dids/location/countries endpoint:
curl --include --get \
--header 'Accept: application/json' \
--header 'X-Auth-Token: YOUR_SANDBOX_TOKEN' \
https://sandbox.api.magictelecom.com/dids/location/countries
{
"data" : {
"results" : [
{
"iso3" : "USA",
"handle" : "UNITED_STATES",
"name" : "United States",
"iso2" : "US",
"dial_code" : 1
},
...
],
"total" : 59,
"limit" : 10,
"page" : 1
},
"code" : 200
}
To find locations where we have DIDs, use the /dids/products/locations endpoint:
curl --include --get \
--header 'Accept: application/json' \
--header 'X-Auth-Token: YOUR_SANDBOX_TOKEN' \
--data 'filter=country_iso2::US' \
https://sandbox.api.magictelecom.com/dids/products/locations
{
"data" : {
"results" : [
{
"name" : "Orlando (407), FL",
"handle" : "ORLANDO__407___FL",
"npa" : 407,
"in_stock" : true,
"_rates" : {
"STANDARD" : {
"monthly_cost" : "0.25",
"initial_cost" : "0.25"
}
},
...
},
...
],
"total" : 1887,
"limit" : 10,
"page" : 1
},
"code" : 200
}
There are many different filters available when searching for countries and locations. Be sure to check out the API Reference for a full list.
Be sure to check out our guide on How to Order DIDs for more information.