Webhooks are used to communicate between two different or same systems. You can use webhooks when you want central to send/receive any data from/to other systems. On Central, you can operate webhooks in 3 different manner, which are as follows -
...
Webhook for flow
On flow complete webhooks are used when you want to push/send all the flow details to the default webhook once the flow gets completed.
...
Go to Advanced → Webhook page
Click on ‘add webhook’
Select the method as ‘Post’
Enter or paste the your external webhook URL and click on ‘check button’.
Once you see a green tick beside check button, select the authentication method.
None : If there is no authentication required
Basic : If username and password is required
Select the body type as ‘None’.
Enable ‘Is default webhook' and click on save button.
...
Enable ‘webhook for the flow’ and done. After ever execution of this flow, all the flow details will be send to the default webhook in the predefined format.
To know more about webhook’s Predefined Format, you can click here. Predefined Format :
Code Block |
---|
{
"callDetails": [
{
"calleeNumber": "Phone number of the callee",
"connectTime": "Timestamp of call when started",
"didNumber": "DID used in call",
"duration": "Total Call duration in seconds",
"endTime": "Timestamp of call when ended",
"hangupCause": "Hangup cause code of the call",
"incoming": True if the call was incoming false otherwise,
"startTime": "Timestamp of call when started"
}
],
"keys": [
{
"name": "$flow.key.variable1",
"value": "value of variable"
},
{
"name": "$flow.key.variable2",
"value": "value of variable"
} // This will be repeated for all the variables passed during the call
],
"phonon-uuid": "Phonon uuid of the call",
"recordingUrls": [
{
"recordedFileName": "file name of the recording",
"recordedFilePublicPath": "URL of the recording, where it is stored"
}
]
} |
Outcome : Everytime the flow is executed, all the flow details (ex- phonon UUID, request ID, CLI number, flow variables etcas mentioned in the format) will be send to the default webhook selected.
...
Go to Advanced → Webhook page
Click on ‘add webhook’
Select the method as ‘Post’
Enter or paste the URL of the internal webhook that you need to call/invoke from the list below
Select ‘none’ in the authentication method and click on the ‘check button’ to verify.
None : If there is no authentication required
Basic : If username and password is required
Select the body type as ‘None’ and click on save button.
...
Select URL : Once you have configured the webhook, you will be able to see that URL in the webhook widget. Select the URL of the webhook that you need to invoke.
Enter Method : Enter the name of the method that you need to call
Select Parameters : Select the parameters that you want to pass. Query parameters are the type of variables that will be passed based on the method selected. You can select multiple parameters.
Call : All the variables of ‘call type’ ($call.cli, $call.state, $call.start etc)
$flow.key : All the variable of type ‘$flow.key’ ($flow.key.<keyname>) will be passed
$user.key : All the user key variables will be passed ($user.key.<keyname>) will be passed. To know more about variables, you can click here.
Document API : You can use this area to document your API that is you can explain or provide some insights of the purpose of this webhook call/API. This is an optional field.
Note :
To know more about webhook methods, you can visit here.
Make sure your HTTP usage is enabled for your account. If not, then you can send a mail to request for the same on support@phonon.io
Make sure to whitelist your IP in the whitelist section of your account
Once any specific method is called, the values will be appeared in the specified response variables.
...
List of Internal Webhook
1. Initiate Outbound Flow
...