New Operations: areaCodes & supportedCountries
Today we’re releasing two new API operations: areaCodes
and supportedCountries
. The idea behind both operations is to give your application information it needs to provide your end-users with better service.
Very simply, the areaCodes operation will give you a list of area codes where we currently have available phone numbers. Much like the rest of Phaxio, the operation works the way you would assume it does: you pass Phaxio either a state or a boolean for toll free numbers (or neither) and we’ll respond will a complete list of the area codes available in that area and, when appropriate, the city and state that the area code serves.
This should help our users that need to provision numbers for their users on the fly. For example, a user signs up for your app and you want to give them a fax number, you can now offer phone number options that you can be sure will be fulfilled. Need a fax number in Albany, New York? Try:
cURL https://api.phaxio.com/v1/areaCodes -F 'state=NY'
Phaxio will respond with:
{
"success": true,
"message": "Data contains all available area codes for NY.
13 area codes available.",
"data": {
"315": {
"city": "Syracuse, Utica",
"state": "New York"
},
"347": {
"city": "Bronx, Brooklyn, Queens",
"state": "New York"
},
"516": {
"city": "Freeport, Garden City, Glen Cove",
"state": "New York"
},
"518": {
"city": "Albany, Schenectady",
"state": "New York"
}
}
}
//(there are more, but this is just an example)
Now your application knows that we have phone numbers for the 518 area code which services Albany and Schenectady, NY.
Much the same, our supportedCountries operation will help you identify which countries we support and the price per page when sending to those countries. If a user needs to know which countries your application supports, just hit:
curl -X POST https://api.phaxio.com/v1/supportedCountries
and we’ll return a list of Phaxio’s supported countries (in JSON of course).
Simple as that.