Click-to-Call
Click to call allows you to create URLs that can be POSTed to with a phone number or SIP URI and create a phone call from the provided contact information to a destination you have pre-determined.
There are two steps to getting this working:
- Create the clicktocall. This sets up the extension number that will be dialled when the clicktocall is initiated. Creating a clicktocall requires an authentication token and will return a uniqueid for that clicktocall. You can create the clicktocall so that authentication is required when initiating the call or not by setting the auth_required property.
- Initiate the clicktocall. By passing a number (contact property) to the clicktocall id created in step 1, the call will be made firstly to the extension specified when the clicktocall was created and then, once that leg of the call is answered, to the number specified in the contact property.
URI
- v1/accounts/{account_id}/clicktocall
Property | Description | Validation | Modifiable | Required |
---|---|---|---|---|
name | Human-friendly name to help identify a particular click-to-call | non_empty_string() | yes | yes |
extension | The number or user to call when this click-to-call is activated | SIP URI or DID or Internal Extension | yes | yes |
realm | The SIP realm the extension belongs to (defaults to the current account's) | FQDN or IP | yes | |
auth_required | Does activating the click-to-call require an authenticated user? If false (the default), authentication is bypassed for the activation request (useful for embedding a form on a public-facing website) |
boolean() | yes | |
whitelist | List of regular expressions that a provided number from the end user must match before the origination will proceed |
list(string()) | [] (defaults to []) | yes | |
throttle | Number of active requests allowed for this click-to-call, 0 for no limit (default) | integer() | yes | |
outbound_callee_id_name | Callerid name to be presented on the outbound call leg | non_empty_string() | yes | |
outbound_callee_id_number | Callerid number to be presented on the outbound call leg | non_empty_string() | yes | |
caller_id_number | Callerid number to be presented on the inbound call leg i.e. the number presented to the extension user before the outbound call is placed | non_empty_string() | yes |
Verb | Accepted | Returned | Description |
---|---|---|---|
GET | id, name, extension, realm | Fetches a summary of click-to-calls | |
PUT | ANY | ALL | Create a new click-to-call |
- Normal Response Code(s): 200
- Error Response Code(s): 400, 401, 415, 500, 503, 504
URI
- v1/accounts/{account_id}/clicktocall/{clicktocall_id}
Property | Description | Validation | Modifiable | Required |
---|---|---|---|---|
name | Human-friendly name to help identify a particular click-to-call | non_empty_string() | yes | yes |
extension | The number or user to call when this click-to-call is activated | SIP URI or DID or Internal Extension | yes | yes |
realm | The SIP realm the extension belongs to (defaults to the current account's) | FQDN or IP | yes | |
auth_required | Does activating the click-to-call require an authenticated user? If false, authentication is bypassed for the activation request (useful for embedding a form on a public-facing website) |
boolean() | yes | |
whitelist | List of regular expressions that a provided number from the end user must match before the origination will proceed |
list(string()) | [] (defaults to []) | yes | |
throttle | Number of active requests allowed for this click-to-call, 0 for no limit (default) | integer() | yes | |
history_items | Number of history items stored | integer() | no | |
outbound_callee_id_name | Callerid name to be presented on the outbound call leg | non_empty_string() | yes | |
outbound_callee_id_number | Callerid number to be presented on the outbound call leg | non_empty_string() | yes | |
caller_id_number | Callerid number to be presented on the inbound call leg i.e. the number presented to the extension user before the outbound call is placed | non_empty_string() | yes |
Verb | Accepted | Returned | Description |
---|---|---|---|
GET | ALL | Fetch the details of a click-to-call | |
POST | ANY | ALL | Update the parameters of a click-to-call |
DELETE | Delete a click-to-call |
- Normal Response Code(s): 200, 201
- Error Response Code(s): 400, 401, 404, 415, 500, 503, 504
URI
- v1/accounts/{account_id}/clicktocall/{clicktocall_id}/connect
Property | Description | Validation | Modifiable |
---|---|---|---|
contact | The number or user to call when this click-to-call is activated | SIP URI or DID | yes |
Verb | Accepted | Returned | Description |
---|---|---|---|
POST | ALL | ALL | Start the call |
GET | Start the call |
Normal Response Code(s): 200, 201
Error Response Code(s): 400, 401, 404, 415, 500, 503, 504
URI
- v1/accounts/{account_id}/clicktocall/{clicktocall_id}/history
Property | Description | Validation | Modifiable | |
---|---|---|---|---|
history | List of past activations for this click-to-call | json_objects() | no | |
Property | Description |
---|---|
contact | Who did we try to call |
timestamp | When did the click-to-call get activated |
call_id | Call ID of the leg out to the contact |
cdr_id | CDR of the leg |
Verb | Accepted | Returned | Description |
---|---|---|---|
GET | ALL | List of History objects |
Normal Response Code(s): 200
Error Response Code(s): 400, 401, 404, 415, 500, 503, 504