SmartCall is the logical combination between the functionality of ClicktoCall and QuickCall. Based on the phone numbers supplied in the json schema SmartCall will automatically determine if the a-leg should be placed to the device assigned to a user, or routed externally like a more traditional ClicktoCall.
Additionally we also simplified and factored down the required actions to create a call event into a single POST.
If the phone number provided in the extension key is assigned to a callflow and that callflow has a user assigned to it, smartcall will process a call to the devices assigned to that user. If the number is not part of a callflow and is not assigned to the account invoked in the API call than we use the number to invoke the ClicktoCall logic, first by dialing the number supplied in the extension key, and then by calling the number in the contact key, very similar to your standard ClicktoCall method.
Schema
Key | Description | Type | Default | Required |
---|---|---|---|---|
caller_id_number | Explicitly set caller id number | string() | true | |
extension | The extension to connect to when the smartcall is invoked | string() | true | |
name | A friendly name for the click to call | string(1..128) | true | |
outbound_callee_id_name | Callee ID Name of the device calling out to the contact number | string() | true | |
outbound_callee_id_number | Callee ID Number of the device calling out to the contact number | string() | true | |
contact | Number of the b-leg party you would like contacted | string() | true |
Please note: that if the number in the extension key is assigned to a callflow with a user, than the user’s Caller ID details are used, and the outbound_callee_id_name and outbound_callee_id_number keys are ignored.
Create
POST /v2/accounts/{ACCOUNT_ID}/smartcall
This API call will create the whole call action using the JSON DATA Schema noted Above and based on the data provided will connect the caller to the contact supplied.
curl -v -X POST \ -H "X-Auth-Token: {AUTH_TOKEN}" \ http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/smartcall \ -d '{"data":{"caller_id_number":"15705551212","name":"Bill's Call","outbound_callee_id_name":"Bill Williams","outbound_callee_id_number":"12125551212","contact":"18005551000"}}'