All API calls will be GET requests with the parameters included in the URL. Each call will be of the following format:
https://api.customtollfree.com/api/command?key=xxx¶m1=xxx¶m2=xxx
As can be seen, the command is a direct part of the URL and every command will require the unique key provided to each user. This key is used to identify the user and which numbers they will be allowed to search.
Command: search
Parameters
Return Results
The API returns a properly formatted XML response. The first item in the XML is the <status> tag and will have a value of SUCCESS or ERROR. If ERROR, the XML will contain a list of <error> items. If SUCCESS, it will contain a list of <item> objects (within a <results> tag). Each <item> object will contain a number prefix, 7 digit number, the vanity, and an optional list of additional number spellings.
Example Call
/search?key=abc123xyz0&vanity=book&source=spare;rugly&quantity=100
Example Return Results
<?xml version="1.0" encoding="UTF-8"?> <response> <status>SUCCESS</status> <results> <item> <prefix>800</prefix> <number>8432665</number> <vanity>800 - THE BOOK</vanity> </item> <item> ... </item> </results> </response>
Command: reserve
Parameters
Return Results
The API returns a properly formatted XML response. The first item in the XML is the <status> tag and will have a value of SUCCESS or ERROR. If ERROR, the XML will contain a list of <error> items. If SUCCESS, the number reserved will be returned inside the <number> tag (enclosed inside the <results> tag).
Example Call
/reserve?key=abc123xyz0&number=8775551234
Example Return Results
<?xml version="1.0" encoding="UTF-8"?> <response> <status>SUCCESS</status> <results> <number>8775551234</number> </results> </response> OR <?xml version="1.0" encoding="UTF-8"?> <response> <status>ERROR</status> <errors> <error> <code>number_unavailable</code> <message>The number is not available for reservation.</message> </error> <errors> </response>
Command: reverselookup
Parameters
Return Results
The API returns a properly formatted XML response. The first item in the XML is the <status> tag and will have a value of SUCCESS or ERROR. If ERROR, the XML will contain a list of <error> items. If SUCCESS, the information will be returned inside the <results> tag.
Example Call
/reverselookup?key=abc123xyz0&number=8775551234
Example Return Results
<?xml version="1.0" encoding="UTF-8"?> <response> <status>SUCCESS</status> <results> <number>8775551234</number> <numberstatus>WORKING</numberstatus> <statusdate>01/01/01</statusdate> <company>Phone Company, Inc.</company> <contactphone>2025551000</contactphone> <website>www.example.com</website> </results> </response> OR <?xml version="1.0" encoding="UTF-8"?> <response> <status>ERROR</status> <errors> <error> <code>number_invalid</code> <message>The number is not a valid toll free number.</message> </error> <errors> </response>
Command:numspell
Parameters
Return Results
The API returns a properly formatted XML response. The first item in the XML is the <status> tag and will have a value of SUCCESS or ERROR. If ERROR, the XML will contain a list of <error> items. If SUCCESS, the number spellings will be returned inside the <results> tag.
Example Call
/numspell?key=abc123xyz0&number=3926753&quantity=2
Example Return Results
<?xml version="1.0" encoding="UTF-8"?> <response> <status>SUCCESS</status> <results> <spelling>example</spelling> <spelling>exam-please</spelling> </results> </response> OR <?xml version="1.0" encoding="UTF-8"?> <response> <status>ERROR</status> <errors> <error> <code>number_invalid</code> <message>The number is not a valid number.</message> </error> <errors> </response>
| request_timeout | request has timed out |
| key_missing | user key is missing |
| key_not_found | key not found |
| key_invalid | invalid key (not 24 characters) |
| vanity_missing | vanity not supplied in search call |
| vanity_invalid | vanity is not alphanumeric |
| invalid_source_format | source paramater is invalid |
| invalid_source | source does not exist |
| prefix_invalid | invalid prefix supplied |
| quantity_invalid | quantity not numeric |
| trailing_invalid | invalid trailing digits (must be 0-5) |
| adult_invalid | invalid adult filter parameter, must be 0 or 1 |
| numeric_invalid | invalid numeric parameter, must be 0 or 1 |
| number_unavailable | the number is not available for reservation |
| number_invalid | the number is not a valid toll free number |