Company: Voice2Phone Software Inc
E-mail: [email protected]
Getting Started
The Voice2Phone Outbound Calling API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.
- Your app makes a HTTP request to Voice2Phone
- Voice2Phone initiates an outbound phone call
- Your end user receives the call
Authentication
API keys allow apps to make requests to Voice2Phone Call API on the behalf of a user. Each API key is unique to the user, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such GitHub, client-side code, and so forth. API keys do not expire, but they may be regenerated by the user. Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail. Your secret API key can be found when you login to your account.
API Responses
Voice2Phone Outbound Call API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided, and codes in the 5xx range indicate an error with Voice2Phone’s servers (these are rare).
200 – OK | Everything worked as expected. |
400 – Bad Request | The request was unacceptable, often due to missing a required parameter. |
401 – Unauthorized | No valid API key provided. |
402 – Request Failed | The parameters were valid but the request failed. |
404 – Not Found | The requested resource doesn’t exist. |
429 – Too Many Requests | Too many requests hit the API too quickly. |
500, 502, 503, 504 – Server Errors | Something went wrong on Voice2Phone’s end. (These are rare.) |
Make an Outbound Phone Call
The following API enables you to make a single call to a landline phone or cell phone.
Request
POST https://api.voice2phone.com/call
Header
Authorization: Your API key
Content-Type: application/json
Body
{
Phone:
{
"Number":"4252337837",
"CountryCode":"US"
},
Message: "Please press one",
Dtmf:
{
"1" : "Thank you"
}
}
Arguments
Phone.Number (mandatory) | The phone number to call. The phone number can be in local or international format. |
Phone.CountryCode (mandatory) | The ISO code A2 of the country. For example: US, CA, GB etc. |
Message (mandatory) | The text to be played during a call using text-to-speech engine. |
Dtmf (optional) | Provides a mapping from a touch-key to a message. |
Response
HTTP Status Code: 200 OK
{
CallId : "54b16dd7-8e68-4a2a-973d-063e39a6998c"
}
Get Call Status
The following API enables you to get information about a call
Request
GET https://api.voice2phone.com/call/{callId}
Header
Authorization: Your API key
Response
HTTP Status Code: 200 OK
{
"CallId": "54b16dd7-8e68-4a2a-973d-063e39a6998c",
"Status": 2,
"CreatedDateUtc": "2016-08-01T18:33:08.997",
"UpdatedDateUtc": "2016-08-01T18:33:08.997",
"Dtmf": "1"
}
Fields
Status | The phone number to call. The phone number can be in local or international format. |
CreatedDateUtc | The ISO code A2 of the country. For example: US, CA, GB etc. |
UpdatedDateUtc | The text to be played during a call using text-to-speech engine. |
Dtmf | Provides a mapping from a touch-key to a message. |