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.

Note that most of this can be reviewed in realtime using the API Explorer App in Flex UC with the exception of the final connect API call found at the bottom of this article.


Schema

KeyDescriptionTypeDefaultRequired
auth_requiredDetermines if this click to call requires valid auth-tokens when invokedboolean()truefalse
caller_id_numberExplicitly set caller id numberstring()false
dial_firstDeterminates what will be dialed first: extension or contactstring('extension' | 'contact')false
extensionThe extension to connect to when the click to call is invokedstring()true
nameA friendly name for the click to callstring(1..128)true
outbound_callee_id_nameCallee ID Name of the device calling out to the contact numberstring()false
outbound_callee_id_numberCallee ID Number of the device calling out to the contact numberstring()false
throttleThe rate that this click to call can be invokedinteger()false
whitelist.[]string(1..)false
whitelistA list of regular expressions that the click to call can dial toarray(string(1..))false

Fetch

GET /v2/accounts/{ACCOUNT_ID}/clicktocall

This API call will pull all the Click to Call IDs that have been created on account.

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall

Create

PUT /v2/accounts/{ACCOUNT_ID}/clicktocall

This API call will allow you to create a new Click to Call ID using the JSON Data Schema noted Above.

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall

Fetch

GET /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

This API call will allow you to display the profile details for a Click to call ID.

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Change

POST /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

This API call will allow you to change the Profile Details on a Click to Call ID

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Remove

DELETE /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

This API call allows you to delete a Click to Call ID

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}

Fetch

GET /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/history

This API call allows you to extract the actions taken on behalf of the requested Click to Call ID.

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/history

Connect

POST /v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect

This API call allows you to connect a Click to Call profile ID to a contact. Please take note, that in this call, you need make sure that your provide a JSON data Packet with the contact details of the party you wish to call. If you note in the below cURL example, the addition of the “-d” directive with an example contact telephone number of 15704213000.

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    http://{SERVER}:{PORT}/v2/accounts/{ACCOUNT_ID}/clicktocall/{C2C_ID}/connect \
    -d '{"data":{"contact":"15704213000"}}'
Updated on June 22, 2021

Was this article helpful?

Related Articles