Area codes
Pick the area code before you buy a number: check it has stock, or let Ready suggest one.
#Check an area code
Whether you can buy a number in an area code.
Parameters
area_codestring · queryRequired- A 3-digit US or Canada area code. A code that isn’t 3 digits, or starts with 0 or 1, answers 400.
Returns
availablebooleantruemeans you can buy a number in that area code now. An area code that doesn’t exist, or that neither Ready nor the carrier has stock in, answersfalse.readyboolean- Only when
availableistrue.true: Ready has a number ready to hand over.false: the number is ordered from the carrier when you buy and is set up in a few minutes. numbers[]object[]- Always empty, kept so existing code that reads it keeps working. You can’t pick a number; Ready assigns one in that area code when you buy.
alternatives[]object[]- When out of stock: up to 5 nearby area codes, each
{ area_code, state, ready }.ready: truemeans a number there can be ready right away.
Errors
| HTTP | Code | When |
|---|---|---|
| 400 | area_code_invalid | Missing, not 3 digits, or starts with 0 or 1. |
| 500 | no code | Ready couldn’t check its stock or the carrier’s just now. This doesn’t mean the area code is sold out. Try again in a minute. |
#Suggest an area code
The local area code for a ZIP code. Without one, Ready uses the ZIP code of your registered business.
Query parameters
zipstring · query- A US ZIP code. Only its first 5 digits are read.
Returns
data.suggestedboolean | nulltruewith an area code, ornullwhen there’s no ZIP code or no area code for it.data.reasonthen says which.data.area_codestring- The suggested area code. Check it with Check an area code before you buy.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | no code | Ready couldn’t read your business ZIP code. Send zip, or try again. |
#Area codes of your contacts
Area codes ranked by how many of your contacts have a number there, so you can buy a number local to most of them.
Returns
data.area_codes[]object[]- Each
{ area_code, contacts }, most contacts first.
Errors
| HTTP | Code | When |
|---|---|---|
| 500 | no code | Ready couldn’t count your contacts just now. Try again. |
See also: the guide to doing this in the app.