Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Internal Webhooks: Use any of the pre-made internal functions. Use this when you need to use any of the commonly used functions.

  2. Webhook Widget: Call any external API using dynamic data and configurable structure. Use this when you want to integrate and use any external API

  3. Flow End Webhook: Call the default external webhook for any flow. Use this when you need to push flow details on a particular webhook. Status

    titleTo be deprecated

1. Internal Webhook

Custom webhooks are internal webhooks which can be used to pass on the data in between the flow execution.

...

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

...

  1. 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’.

  2. 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.

  3. 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 -

    1. 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

  • INFORMATIONAL - 1XX

  • SUCCESSFUL - 2XX

  • REDIRECTION - 3XX

  • CLIENT_ERROR - 4XX

  • SERVER_ERROR - 5XX

$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

  • AUTHENTICATION_FAILURE: If Basic authentication failed

  • TIMEOUT: If no response was received in the threshold duration

  • INVALID_FLOW_VAR: If not able to parse any mandatory flow variable (inc. in URL)

  • INVALID_REQUEST: If there was any error in Request formation (URL validation, Headers) at runtime

  • INVALID_RESPONSE: If the response cannot be parsed in the selected type

  • INVALID_RESPONSE_MAP: If there was any error in Response Mapping (bad map) etc..

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

  1. For Success : Line 0

  2. For Failure : Line 1

...

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 :

Please note:

  1. callDetails: [ Array of each call leg.

    1. calleeType: Agent for agent leg, and VISITOR for customer leg.

    2. duration: Duration of the leg in milliseconds

    3. hangupCause: Why was the call disconnected. 16 is normal clearing.

  2. keys: Array of each flow variable set in the flow

    1. name: name of the flow variable

    2. value: value of the flow variable

  3. phonon-uuid: Unique identifier of the whole call

Code Block
languagejson
{
	"callDetails": [
		{
			"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"
		},
		{
			"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": [
		{
			"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.

...

  1. 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.

  2. 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.