-
Notifications
You must be signed in to change notification settings - Fork 18
There are some libraries for accessing this API in several languages:
Authentication is always http://en.wikipedia.org/wiki/Basic_access_authentication with the account email as the username and the account password as the password.
This action enqueues a call in Verboice.
HTTP GET /api/call?channel=<channel>&address=<address>
or
HTTP POST /api/call
- channel: the name of the channel in which to enqueue the call
- address: the phone number or sip address to call
These are the different ways to specify a call flow to execute:
- Specify a call_flow_id parameter with the id of a call flow
- Speficy a call_flow parameter with the name of a call flow
- Speficy the flow in the POST data as, for example, a http://www.twilio.com/docs/api/twiml. In this case the project will be the one associated to the channel specified with the channel parameter, or can be overwritten by specifying a project_id parameter with the id of a project.
These can be specified with query parameters. For example, to define an "age" variable with value 38, you can do:
HTTP GET /api/call?channel=<channel>&address=<address>&vars[age]=38
- schedule_id or schedule to specify the schedule to use with and id or name, respectively
- not_before to specify that the call must not be issued before a date (for example: '2012-01-02 10:11:12')
- not_after to specify that the call must not be issued after a date (for example: '2012-01-02 10:11:12')
- time_zone to specify a time zone for the previous parameter (for example: 'Buenos Aires')
HTTP GET /api/calls/<call_ID>/details.json
Returns the following fields in a JSON object, new on 3.0:
call_id state project_id project_name started_at finished_at not_before direction channel_id channel_name call_flow_id call_flow_name contact_id contact_address schedule_id schedule_name fail_reason fail_code fail_details
HTTP GET /api/projects/<project_id>/contacts.json
Example response:
[ { id: 1, addresses: ["1543949458", "1543949459"], vars: {age: 38, "favorite color": "blue"} }, { id: 2, addresses: ["1556948544"], vars: {age: 42} }, ]
HTTP GET /api/projects/<project_id>/contacts/by_address/<address>.json
Example request:
HTTP GET /api/projects/<project_id>/contacts/by_address/1543949458.json
Example response:
{ id: 1, addresses: ["1543949458", "1543949459"], vars: {age: 38, "favorite color": "blue"} }
HTTP PUT /api/projects/<project_id>/contacts/by_address/<address>.json?vars[var_name]=var_value
The PUT body must be empty, but must still be specified (with length 0). The response is the updated contact, as a JSON.
Example request:
HTTP PUT /api/projects/<project_id>/contacts/by_address/1543949458.json?vars[age]=39
Example response:
{ id: 1, addresses: ["1543949458", "1543949459"], vars: {age: 39, "favorite color": "blue"} }
HTTP PUT /api/projects/<project_id>/contacts/all.json?vars[var_name]=var_value
The PUT body must be empty, but must still be specified (with length 0). The response is the updated contacts, as a JSON.
Example request:
HTTP PUT /api/projects/<project_id>/contacts/all.json?vars[age]=39
Example response:
[ { id: 1, addresses: ["1543949458", "1543949459"], vars: {age: 39, "favorite color": "blue"} }, { id: 2, addresses: ["1556948544"], vars: {age: 39} }, ]