...
You do not need to bother about the request body or need to specify the variables that needs to be passed. You can simply follow the below steps to invoke any webhook in between the flow. To know about all internal webhooks, you can click here.
Step 0: Enable HTTP Support
...
Wait for response : Enable if you want to wait for the response of your request. You can play hold music meanwhile by enabling ‘Enable hold music’. The maximum response wait time is ‘60 seconds’.
Persist Response : Enable if you want to retain the value of flow variables after the flow execution is completed. Use this only if you need to save the data and use it later, example as a UDF in Reports.
Flow Variables : Once the execution of webhook widget is over, you will be able to get some of the values in the specified flow variables. There is a collapsible menu under success and failed section. You can click on that to know about these specified flow variables in the widget. The flow variables are as follows -
On Success -
Flow Variable | Description | Example Value |
---|---|---|
$flow.key.response_status | API call Success or Failure status | SUCCESS |
$flow.key.response_status_code | Status Code for response(2XX) | 200, 401 etc |
$flow.key.response_duration | Duration in seconds for the API to return data | 0.11 |
$flow.key.response_raw | Raw response received from server, null if empty | {...} |
$flow.key.response_error | If API resulted in error, Boolean true or false | false |
b. On Failure -
Flow Variable | Description | Example Value |
---|---|---|
$flow.key.response_status | API call Success or Failure status | FAILED |
$flow.key.response_status_code | Status Code for response | 401, 200 etc |
$flow.key.response_status_type | Type of error, based on status code |
|
$flow.key.response_duration | Duration in seconds for the API to return data | 0.11 |
$flow.key.response_raw | Raw response received from server, null if empty | {...} |
$flow.key.response_error | If API resulted in error, Boolean true or false. True if error occured | true |
$flow.key.error_reason | Reason for failure |
|
Info |
---|
Moving Forward : Once the execution of the webhook widget is completed, according to the response the flow will move forward in that direction, that is
|
...
Info |
---|
If you see the switch is disabled, check if the webhook is properly configured and set as default. You can see if the status in “Webhook for Account is” is “Not Configured” then click on Configure Webhook to configure it. |
...
Predefined Format for single call leg flow :
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 (as mentioned in the format) will be send Predefined Format for flow with two call legs, i.e customer and agent call legs in outbound multicast flow :
Code Block |
---|
{
"callDetails" : [
{ //All the details of this object is of first leg
"calleeNumber" : "919879072567",
"calleeType" : "VISITOR",
"cdrId" : "f1ca3a63-7eb7-4a8d-b50c-fbbdd3807034##pbx-9",
"connectTime" : "2022-01-17T18:07:28.889+05:30",
"didNumber" : "912243690284",
"duration" : "15962",
"endTime" : "2022-01-17T18:07:44.851+05:30",
"hangupCause" : "16",
"incoming" : false,
"remoteHangup" : false,
"startTime" : "2022-01-17T18:07:21.952+05:30" },
{ // All the details of this object is of second leg
calleeNumber" : "919822003887",
"calleeType" : "AGENT",
"cdrId" : "f7d646de-44af-4037-8722-2346fb11de86##pbx-9",
"connectTime" : "2022-01-17T18:07:40.142+05:30",
"didNumber" : "912243690284",
"duration" : "4670",
"endTime" : "2022-01-17T18:07:44.812+05:30",
"hangupCause" : "16",
"remoteHangup" : true,
"startTime" : "2022-01-17T18:07:31.153+05:30" } ],
"keys" : [ { //flow key variables as per the usecase
"name" : "$flow.key.customernum",
"value" : "919822003887"
}, {
"name" : "$flow.key.leadid",
"value" : "HFC123"
}, {
"name" : "$flow.key.empid",
"value" : "IIFL123"
}, {
"name" : "$flow.key.isTTSUsed",
"value" : true
} ],
"phonon-uuid" : "9d34878d-01a0-45ba-b5d6-6b097ae17611" }
|
Outcome : Everytime the flow is executed, all the flow details (as mentioned in the format) will be sent to the default webhook selected.
...
If you want to send some additional data at the end of the flow in some different format, then you can use a webhook widget after ‘on flow complete’ widget.
This functionality will be modified in the near future.
...
FAQs
Question | Answer | |
---|---|---|
1 | Is it possible to change the Hold Music in Webhook Widget? | No. The Hold Music is the default hold music. |
2 | “Enable Webhook for Flow” is disabled. | Default Webhook is not configured. Please follow all the steps from the guide again. |