To Create a Webhook
Description:
You can use this API to create a webhook in your portal.
Requested Payload:
- type (Mandatory) - To list the specific type of webhooks, the value of the type can be data or administration.
- events - To specify the list of events that you should to be notified (ex: conversation.created.)
- url - The webhook URL to which the events will be notified through a POST request. While creating a webhook URL for a webhook, a HEAD request is made to the webhook URL. The webhook should return a success response with HTTP Code 200. Else, an exception will be thrown.
- app_ids - The list of app IDs to which the webhook needs to be associated (applicable only for Data webhook.)
- secured - To send a verification signature during the webhook invocation and check if the connection is secure (value: true/false).
- version - The version of the webhook. During the notification or invocation, the webhook payload version will be based on this version.
- expiry_time_for_executions_data - The time period in milliseconds for which the failed executions for the particular webhook is being retained in SalesIQ. Minimum of one week and maximum of 60 days, By default, it is 60 days.
OAuth Scope:
SalesIQ.webhooks.CREATE
URL:
Copiedhttps://{zohosalesiq_server_uri}/api/v2/{screenname}/webhooks
Example
Copiedhttps://salesiq.zoho.com/api/v2/zylker/webhooks
Payload
Copied{
"type": "data",
"url": "https://zylker.com/webhooks.ext",
"events": [
"conversation.created",
"conversation.missed",
"conversation.visitor.replied",
"conversation.operator.replied",
"conversation.rated"
],
"secured": true,
"app_ids": [
"19367000000002043"
],
"version": "1",
"expiry_time_for_executions_data" : "180000000"
}
Sample Response
Copied{
"url": "/api/v2/zylker/webhooks",
"object": "webhook",
"data": {
"modified_time": "1566841793192",
"url": "https://zylker.com/webhooks.ext",
"expiry_time_for_executions_data": "180000000",
"id": "19367000000120011",
"modifier": {
"id": "19367000000002079"
},
"creator": {
"id": "19367000000002079"
},
"status": "enabled",
"failures_count": "0",
"secured": true,
"app_ids": [
"19367000000002043"
],
"version": 1,
"type": "data",
"public_keys": [
{
"key": "",
"creator": {
"id": "19367000000002079"
},
"created_time": "1566676375915",
"id": "1566676375915"
}
],
"created_time": "1566676375741",
"events": [
"conversation.created",
"conversation.missed",
"conversation.visitor.replied",
"conversation.operator.replied",
"conversation.rated"
]
},
"sync_time": "1566888552910"
}