Webhooks

Webhooks

What are Webhooks?

Webhooks operate on the concept of “event reaction” and thus avoids the need for constant polling of the server-side application by the client-side application. Therefore, rather than the client-side application constantly polling the server-side application to check for new events, the server-side application calls the client-side application (by invoking a client provided webhook URL) anytime the server-side has something new to report to the client. This is the core concept of the webhook. 

Benefits:

  1. With webhooks, you can get push notifications when certain events happen on the server. You do not need to poll the API anymore to observe if these events have occurred. You can just ‘subscribe’ to an event with webhooks. 
  2. Webhooks are powerful resources that you can use to automate your use cases and improve your productivity. Unlike the API resources, which represent static data that you can create, update and retrieve as needed, webhooks represent dynamic resources. You can configure them to automatically notify you when a customer has taken a particular action, such as initiating or replying to a conversation.

Creating and Managing Webhooks

You can create and manage the webhooks with the REST API available  here 

Trusted source validation (via signature):

What is a public key and how to generate it via API?
SalesIQ signs every webhook event passed on to the endpoint URL using RSA Cryptosystem.
  1. We use SHA256 with RSA as the signature algorithm.
  2. The signature is Base64 encoded
  3. The charset used is UTF-8
The generated Public key can be copied and saved in the endpoint server, which can later be used to check the authenticity of the data received with the signature attached. We will generate a public and a private key pair.
To  generate the public key  use the following API:
  1. API: /api/v2/{screenname}/webhooks/{id}/keys
  2. METHOD : POST
  3. Scope: SalesIQ.webhooks.CREATE
To  delete the public key  use the following API:
  1. API: /api/v2/{screenname}/webhooks/{id}/keys/{keyid}
  2. METHOD : DELETE
  3. Scope: SalesIQ.webhooks.DELETE 
The trusted source validation is to secure the Webhooks, i.e., for you (integration services) to verify the data sent is from SalesIQ services by getting the public key in the API response and validating the signature available in the x-siqsignature request headers for that data. If the signature is valid, then the source can be trusted. This process is to secure the Webhooks from unauthorized access.

To validate the source with the help of signature header:
  1. HEADERS : 
  2. {
  3. x-siqsignature : $signature 
  4. }
If you wish to set up a secure callback, then create the webhook and set the secure as true ("secured:true".)
  1. Payload: 
  2. {
  3. webhook : {
  4. url : $webhookurl,
  5. secured : <boolean>},
  6. published : <boolean>
Note:
  1. Maximum Admin webhooks allowed per portal is 3
  2. Maximum auto retry count for a webhook is 3
  3. Auto retry occur after a minute
  4. Timeout per execution is 5 seconds
  5. Default error log retention period is 60 days
  6. Webhooks are available only in the Enterprise plan

Webhook Payload

The webhook is invoked when the event you've subscribed occur in SalesIQ. For example, if you have subscribed for conversation.visitor.replied then when a visitor replies to the chat then you'll be notified with some data. 

Payload definition:

  1. version - The version of the webhook payload.
  2. event - The event notified.
  3. event_time - The time at which the event happened
  4. org_id - Your SalesIQ portal ID
  5. app_id - Your embed ID, available only for data events
  6. attempt - The number of attempts made to notify an event through webhook
  7. entity - The entity of the event occurred
  8. entity_type - The type of the entity (ex: Bot, department, operator)
  9. entity_id - Unique id of the entity. For ex, conversation id in case of conversation.* events
  10. modified_fields - List of properties modified
The payload should be received in the below format.
  1. {
  2. "version" : "1",
  3. "event" : "operator.created",
  4. "event_time" : $time of event,
  5. "org_id" : $soid,
  6. "app_id" : $appid,
  7. "attempt" : $count of retry,
  8. "entity_type" : $type of entity,
  9. "entity_id" : $ID,
  10. "entity" : {
  11. $ENTITY OBJECT
  12. },
  13. "modified_fields" : [ ]
  14. }
Example:
  1. {
  2. "entity_type":"conversation",
  3.  "org_id":"14327896",
  4.  "event":"conversation.operator.replied",
  5.  "entity_id":"8000000004009",
  6.  "attempt":1,
  7.  "version":"1",
  8. "app_id":8000000000047,
  9.  "entity":{
  10.       "id":"8000000004009",
  11.       "message":{
  12.       "sender":{
  13.       "name":"Tricia",
  14.       "id":"8000000000005"
  15. },
  16.  "msgid":"1566480708251",
  17.  "text":"Hello, I need some help with the shipping status"
  18. }
  19. },
  20.  "event_time":1566480708268
  21. }

Events:

With Webhooks, you can get notified when certain events happen on SalesIQ. If you have subscribed to the following list of events then you will be notified with the data when the respective event occur. 

Webhook Modules:

The following modules are available and you can be notified when an action relating to that module occurs. 
  1. Conversation : A conversation lets you track and describe communications with your website visitors. The conversation can have the visitor/operator messages, the operator involved, the admin/supervisor assigned to the conversation and other information related to the conversation.
  2. Department :

Conversation

A conversation lets you track and describe communications with your website visitors. The conversation can have the visitor/operator message, the operator involved, the admin/supervisor assigned to the conversation and other information related to the conversation.

List of conversation events:
  1. conversation.created
  2. conversation.attender.updated
  3. conversation.missed
  4. conversation.completed
  5. conversation.rated
  6. conversation.visitor.replied
  7. conversation.operator.replied

conversation.created

You can subscribe to this event if you wish to be notified when a visitor initiates a chat.

  1. Payload:
  2. {
  3.   "id": "17000000004021",
  4.   "visitor_conversation_id": "ad433hjdid546f8n4b734j4omfhjsrwnet46fklf7",
  5.   "reference_id": "1",
  6.   "opened_time": "1556866331533",
  7.   "attended_time": "1556866331553",
  8.   "end_time": "1556866331929",
  9.   "missed_time": "1556866333232",
  10.   "app_id": "30185567778889",
  11.   "department_id": "301050000004",
  12.   "owner": {
  13.     "id": "30102333033335",
  14.     "name": "Patricia",
  15.     "email_id": "patricia@zylker.com"
  16.   },
  17.   "visitor":{
  18.         "email_id":"tricia@zylker.com",
  19.         "phone":"1234354",
  20.         "name":"Tricia",
  21.         "type" : "contact",
  22.         "id": "30000000090034"
  23.   },
  24.   "question": "Hi, I need some assistance in buying a dining set.",
  25.   "supervisors": [
  26.     "30102333033336",
  27.     "30102333033337"
  28.   ],
  29.   "participants": [
  30.     "30102333033336",
  31.     "30102333033337"
  32.   ],
  33.   "status": "Live",
  34.   "chat_status": {
  35.     "status_code": [
  36.       "1,2"
  37.     ],
  38.     "state": [
  39.       "1,2,3,4"
  40.     ],
  41.     "label": "Live"
  42.   }
  43. }

conversation.attender.updated

You can subscribe to this event if you wish to be notified when operators pick up a chat.

  1. Payload:

  2. {
  3.   "id": "17000000004021",
  4.   "visitor_conversation_id": "ad433hjdid546f8n4b734j4omfhjsrwnet46fklf7",
  5.   "reference_id": "1",
  6.   "opened_time": "1556866331533",
  7.   "attended_time": "1556866331553",
  8.   "end_time": "1556866331929",
  9.   "missed_time": "1556866333232",
  10.   "app_id": "30185567778889",
  11.   "department_id": "301050000004",
  12.   "owner": {
  13.     "id": "30102333033335",
  14.     "name": "Patricia",
  15.     "email_id": "patricia@zylker.com"
  16.   },
  17.   "visitor":{
  18.         "email_id":"tricia@zylker.com",
  19.         "phone":"124534354",
  20.         "name":"Tricia",
  21.         "type" : "contact",
  22.         "id": "30000000090034"
  23.      }
  24.   },
  25.   "question": "Hi, I need some assistance in buying a dining set.",
  26.   "supervisors": [
  27.     "30102333033336",
  28.     "30102333033337"
  29.   ],
  30.   "participants": [
  31.     "30102333033336",
  32.     "30102333033337"
  33.   ],
  34.   "status": "Connected",
  35.   "chat_status": {
  36.     "status_code": [
  37.       "1,2"
  38.     ],
  39.     "state": [
  40.       "1,2,3,4"
  41.     ],
  42.     "label": "Attended Online"
  43.   }
  44. }

conversation.missed

You can subscribe to this event if you wish to be notified when a chat initiated by the visitor is not picked by any operator and missed.

  1. Payload:
  2. {
  3.   "id": "17000000004021",
  4.   "visitor_conversation_id": "ad433hjdid546f8n4b734j4omfhjsrwnet46fklf7",
  5.   "reference_id": "1",
  6.   "opened_time": "1556866331533",
  7.   "attended_time": "1556866331553",
  8.   "end_time": "1556866331929",
  9.   "missed_time": "1556866333232",
  10.   "app_id": "30185567778889",
  11.   "department_id": "301050000004",
  12.   "owner": {
  13.     "id": "30102333033335",
  14.     "name": "Patricia",
  15.     "email_id": "patricia@zylker.com"
  16.   },
  17.   "visitor":{
  18.         "email_id":"tricia@zylker.com",
  19.         "phone":"12344354",
  20.         "name":"Tricia",
  21.         "type" : "contact",
  22.         "id": "30000000090034"
  23.   },
  24.   "question": "Hi, I need some assistance in buying a dining set.",
  25.   "supervisors": [
  26.     "30102333033336",
  27.     "30102333033337"
  28.   ],
  29.   "participants": [
  30.     "30102333033336",
  31.     "30102333033337"
  32.   ],
  33.   "status": "Missed",
  34.   "chat_status": {
  35.     "status_code": [
  36.       "1,2"
  37.     ],
  38.     "state": [
  39.       "1,2,3,4"
  40.     ],
  41.     "label": "Tracked in CRM"
  42.   }
  43. }

conversation.operator.replied

You can subscribe to this event if you wish to be notified when an operator replies to the chat initiated by the visitor.

  1. Payload:

  2. {
  3. "id":"8000000004009",
  4. "message":{
  5. "sender":{
  6. "name":"Tricia",
  7. "id":"8000000000005"
  8. },
  9. "msgid":"1566480708251",
  10. "text":"Hi, I need some assistance in buying a dining set."
  11. },
  12. "visitor":{
  13. "email_id":"tricia@zylker.com",
  14. "phone":"12344354",
  15. "name":"Tricia",
  16. "type" : "contact",
  17. "id": "30000000090034"
  18. },
  19. "owner":{
  20. "id":"30102333033335",
  21. "name":"Patricia",
  22. "email_id":"patricia@zylker.com"
  23. },
  24. "version":1
  25. }

  26. Bot Conversation Payload:

  27. {
  28. message : {
  29. "sender" : {
  30. "id" : $sender wms id,
  31. "name" : $sender name
  32. },
  33. "text" : $msg,   // Absent for bot message
  34. "msgid" : $msg id,   // Absent for bot message
  35. "meta" : $meta data, ---> applicable for bot message
  36. "list" : [
  37. $MESSAGE LIST
  38. ]

  39. }
  40. }

conversation.visitor.replied

You can subscribe to this event if you wish to be notified when a visitor replies.

  1. Payload:

  2. {
  3.   "id": "8000000005001",
  4.   "message": {
  5.     "sender": {
  6.       "name": "Tricia",
  7.       "id": "$2463902591169630574"
  8.     },
  9.     "msgid": "1566481170562",
  10.     "text": "Hi, i need some assistance in buying a dining set"
  11.   },
  12.   "owner": {
  13.     "id": "30102333033335",
  14.     "name": "Patricia",
  15.     "email_id": "patricia@zylker.com"
  16.   },
  17.   "visitor":{
  18.         "email_id":"tricia@zylker.com",
  19.         "phone":"1234354",
  20.         "name":"Tricia",
  21.         "type" : "contact",
  22.         "id": "30000000090034"
  23.   },
  24.   "version": 1
  25. }

conversation.completed

You can subscribe to this event if you wish to be notified when a chat conversation ends.

  1. Payload:
  2. {
  3.   "id": "17000000004021",
  4.   "visitor_conversation_id": "ad433hjdid546f8n4b734j4omfhjsrwnet46fklf7",
  5.   "reference_id": "1",
  6.   "opened_time": "1556866331533",
  7.   "attended_time": "1556866331553",
  8.   "end_time": "1556866331929",
  9.   "missed_time": "1556866333232",
  10.   "app_id": "30185567778889",
  11.   "department_id": "301050000004",
  12.   "owner": {
  13.     "id": "30102333033335",
  14.     "name": "Patricia",
  15.     "email_id": "patricia@zylker.com"
  16.   },
  17.   "visitor":{
  18.      "email_id":"tricia@zylker.com",
  19.      "phone":"12344354",
  20.      "name":"Tricia",
  21.      "type" : "contact",
  22.      "id": "30000000090034"
  23.   },
  24.   "question": "Hi, I need some assistance in buying a dining set.",
  25.   "supervisors": [
  26.     "30102333033336",
  27.     "30102333033337"
  28.   ],
  29.   "participants": [
  30.     "30102333033336",
  31.     "30102333033337"
  32.   ],
  33.   "status": "Closed",
  34.   "chat_status": {
  35.     "status_code": [
  36.       "1,2"
  37.     ],
  38.     "state": [
  39.       "1,2,3,4"
  40.     ],
  41.     "label": "Attended by Email"
  42.   }
  43. }

conversation.rated

You can subscribe to this event if you wish to be notified when the visitor rate or provide feedback for the chat conversation they had with the operator.

  1. Payload for rating:
  2. {
  3.   "rating": 4,
  4.   "feedback": "Good support",
  5.   "owner": {
  6.     "id": "30102333033335",
  7.     "name": "Patricia",
  8.     "email_id": "patricia@zylker.com"
  9.   },
  10.   "visitor":{
  11.         "email_id":"tricia@zylker.com",
  12.         "phone":"12344354",
  13.         "name":"Tricia",
  14.         "type" : "contact",
  15.         "id": "30000000090034"
  16.   }
  17. }

  18. Payload for feedback:

  19. {
  20.   "entity_type": "conversation",
  21.   "org_id": "55778119",
  22.   "event": "conversation.rated",
  23.   "entity_id": "40526000001808033",
  24.   "attempt": 1,
  25.   "version": "1",
  26.   "app_id": 40526000000002040,
  27.   "entity": {
  28.     "owner": {
  29.       "name": "Patricia",
  30.       "email_id": "patricia@zylker.com"
  31.       "id": "40526000000002001"
  32.     },
  33.     "feedback": "Awesome support from the reps!",
  34.     "id": "40526000001808033",
  35.     "status": "Ended",
  36.     "visitor":{
  37.         "email_id":"tricia@zylker.com",
  38.         "phone":"12344354",
  39.         "name":"Tricia",
  40.         "type" : "contact",
  41.         "id": "30000000090034"
  42.        }
  43.   },
  44.   "event_time": "1567065865617"
  45. }

Departments:

There are two different types of event in the Webhooks: Data and administration. The departments is an administration event, you can subscribe to the event and get notified when a new department is created, updated or deleted.

List of department events:
  1. department.created
  2. department.deleted
  3. department.updated

department.created

You can subscribe to this event if you wish to notify whenever a new department is created inside the portal.

  1. Payload:

  2. {
  3.   "entity_type": "department",
  4.   "org_id": "55778119",
  5.   "event": "department.created",
  6.   "entity_id": "40526000001808025",
  7.   "attempt": 1,
  8.   "version": "1",
  9.   "entity": {
  10.     "is_enabled": "true",
  11.     "created_time": "1571032858870",
  12.     "modified_time": "1571032858870",
  13.     "operators": [
  14.       "6000000000005"
  15.     ],
  16.     "is_system_generated": "false",
  17.     "name": "Support",
  18.     "is_public": "true",
  19.     "email_configurations": {
  20.       "missedchat_recipients": "",
  21.       "cc_recipients": "",
  22.       "is_blockip_mail_enabled": "true",
  23.       "from_email": "tricia@zylker.com",
  24.       "transcript_recipients": "tricia@zylker.com",
  25.       "is_feedback_mail_enabled": "true",
  26.       "blockip_recipients": "",
  27.       "feedback_recipients": "",
  28.       "is_missedchat_mail_enabled": "true",
  29.       "is_cc_mail_enabled": "true",
  30.       "is_transcript_mail_enabled": "true"
  31.     },
  32.     "description": "A team to support the visitors on your site",
  33.     "id": "6000000009015",
  34.     "display_name": "Zylker-support",
  35.     "created_by": "6000000000005"
  36.   },
  37.   "event_time": "1567065647511"
  38. }

department.deleted

You can subscribe to this event if you wish to get notified when a department is deleted in the portal. 

  1. Payload:

  2. {
  3.   "entity_type": "department",
  4.   "org_id": "55778119",
  5.   "event": "department.deleted",
  6.   "entity_id": "40526000001808025",
  7.   "attempt": 1,
  8.   "version": "1",
  9.   "event_time": "1567065647511"
  10. }

department.updated

You can subscribe to this event if you wish to get notified when a details in the department is updated.

  1. Payload:

  2. {
  3.   "entity_type": "department",
  4.   "org_id": "55778119",
  5.   "event": "department.updated",
  6.   "entity_id": "40526000001808025",
  7.   "attempt": 1,
  8.   "version": "1",
  9.   "entity": {
  10.     "is_enabled": "true",
  11.     "created_time": "1571032858870",
  12.     "modified_time": "1571032858870",
  13.     "operators": [
  14.       "6000000000005"
  15.     ],
  16.     "is_system_generated": "false",
  17.     "name": "Support",
  18.     "is_public": "true",
  19.     "email_configurations": {
  20.       "missedchat_recipients": "",
  21.       "cc_recipients": "",
  22.       "is_blockip_mail_enabled": "true",
  23.       "from_email": "tricia@zylker.com",
  24.       "transcript_recipients": "tricia@zylker.com",
  25.       "is_feedback_mail_enabled": "true",
  26.       "blockip_recipients": "",
  27.       "feedback_recipients": "",
  28.       "is_missedchat_mail_enabled": "true",
  29.       "is_cc_mail_enabled": "true",
  30.       "is_transcript_mail_enabled": "true"
  31.     },
  32.     "description": "A team to support the visitors on your site",
  33.     "id": "6000000009015",
  34.     "display_name": "Zylker-support",
  35.     "created_by": "6000000000005"
  36.   },
  37.   "event_time": "1567065647511"
  38. }

Operators

There are two different types of events in the Webhooks: Data and administration. The Operators are an administration event, you can subscribe to this and get notified when an operator event is performed.

List of Operator events:
  1. operator.created
  2. operator.updated
  3. operator.deleted
  4. operator.departments.associated
  5. operator.departments.dissociated

operator.created

You can subscribe to this event if you wish to get notified whenever a new operator is added to your organization.

Payload:
  1. {
  2.     "entity_type": "operator",
  3.     "org_id": "15188410",
  4.     "event": "operator.created",
  5.     "entity_id": "115000000029087",
  6.     "attempt": 1,
  7.     "version": "1",
  8.     "entity": {
  9.         "email_id": "patricia@zylker.com",
  10.         "access_levels": [
  11.             "chat",
  12.             "tracking"
  13.         ],
  14.         "role": "Administrator",
  15.         "signature": "2e8132839ffef039e24ab8e162b5b1f1",
  16.         "date_of_birth": "",
  17.         "description": "",
  18.         "language": "",
  19.         "chat_enabled": true,
  20.         "type": "Salesiq User",
  21.         "locale": "",
  22.         "confirmed": false,
  23.         "enabled": true,
  24.         "notify": {
  25.             "return_visit": false,
  26.             "new_visit": false
  27.         },
  28.         "modified_time": "1596093400214",
  29.         "id": "115000000029087",
  30.         "departments": [
  31.             "115000000004001",
  32.             "115000000000018"
  33.         ],
  34.         "first_name": "",
  35.         "owner": false,
  36.         "created_time": "1596093400198",
  37.         "time_format": "12 hours",
  38.         "address": {
  39.             "country": "",
  40.             "pincode": "",
  41.             "city": "",
  42.             "street": "",
  43.             "state": ""
  44.         },
  45.         "maximum_concurrent_chat": "none",
  46.         "image_url": "",
  47.         "mobile": "",
  48.         "last_name": "",
  49.         "time_zone": "",
  50.         "locale_country": "",
  51.         "deleted": false,
  52.         "phone": "",
  53.         "nick_name": "Patricia",
  54.         "social_media": {
  55.             "twitter": {
  56.                 "profile_url": ""
  57.             },
  58.             "linkedin": {
  59.                 "profile_url": ""
  60.             },
  61.             "enabled": false
  62.         },
  63.         "status": "Available"
  64.     },
  65.     "event_time": "1596093402483"
  66. }

operator.updated

You can subscribe to this event if you wish to be notified whenever an operator's setting is modified.
Payload:
  1. {
  2.     "entity_type": "operator",
  3.     "org_id": "15188410",
  4.     "event": "operator.updated",
  5.     "entity_id": "115000000000094",
  6.     "attempt": 1,
  7.     "version": "1",
  8.     "entity": {
  9.         "email_id": "patricia@zylker.com",
  10.         "access_levels": [
  11.             "chat",
  12.             "tracking"
  13.         ],
  14.         "role": "Administrator",
  15.         "signature": "2e8132839ffef039e7eaaa00748b47ec",
  16.         "date_of_birth": "",
  17.         "description": "",
  18.         "language": "en",
  19.         "chat_enabled": true,
  20.         "type": "Salesiq User",
  21.         "locale": "en",
  22.         "confirmed": true,
  23.         "enabled": true,
  24.         "notify": {
  25.             "return_visit": false,
  26.             "new_visit": false
  27.         },
  28.         "modified_time": "1596092957234",
  29.         "id": "115000000000094",
  30.         "departments": [
  31.             "115000000000018"
  32.         ],
  33.         "first_name": "Patricia",
  34.         "owner": false,
  35.         "created_time": "1594720783132",
  36.         "time_format": "12 hours",
  37.         "address": {
  38.             "country": "us",
  39.             "pincode": "625012",
  40.             "city": "Malibu",
  41.             "street": "Pacific Coast Highway",
  42.             "state": "California"
  43.         },
  44.         "maximum_concurrent_chat": "none",
  45.         "image_url": "",
  46.         "mobile": "08903694722",
  47.         "last_name": "Smith",
  48.         "time_zone": "United States/California",
  49.         "zuid": "15102744",
  50.         "locale_country": "us",
  51.         "deleted": false,
  52.         "phone": "1234567890",
  53.         "nick_name": "Patricia",
  54.         "social_media": {
  55.             "twitter": {
  56.                 "profile_url": ""
  57.             },
  58.             "linkedin": {
  59.                 "profile_url": ""
  60.             },
  61.             "enabled": false
  62.         },
  63.         "status": "Available"
  64.     },
  65.     "event_time": "1596092957257"
  66. }

operator.deleted

You can subscribe to this event if you wish to be notified when an operator is removed.

Payload:
  1. {
  2.     "entity_type": "operator",
  3.     "org_id": "15188410",
  4.     "entity_id": "115000000029087",
  5.     "event": "operator.deleted",
  6.     "version": "1",
  7.     "attempt": 1,
  8.     "event_time": "1596093526367"
  9. }

operator.departments.associated

You can subscribe to this event if you wish to get notified whenever an operator is associated with a department.
Payload:
  1. {
  2.     "entity_type": "operator",
  3.     "org_id": "15188410",
  4.     "event": "operator.departments.associated",
  5.     "entity_id": "115000000000006",
  6.     "attempt": 1,
  7.     "version": "1",
  8.     "entity": {
  9.         "departments": [
  10.             "115000000004001"
  11.         ],
  12.         "id": "115000000000006"
  13.     },
  14.     "event_time": "1596094781678"
  15. }

operator.departments.dissociated

You can subscribe to this event if you wish to get notified when an operator is removed from a department.
Payload:
  1. {
  2.     "entity_type": "operator",
  3.     "org_id": "15188410",
  4.     "event": "operator.departments.dissociated",
  5.     "entity_id": "115000000000006",
  6.     "attempt": 1,
  7.     "version": "1",
  8.     "entity": {
  9.         "departments": [
  10.             "115000000004001"
  11.         ],
  12.         "id": "115000000000006"
  13.     },
  14.     "event_time": "1596094781678"
  15. }

Visitors

There are two different types of events in the Webhooks: Data and administration. The Visitors are data event, you can subscribe to this and get notified when a visitor event is performed.

List of Visitor events:
  1. visitor.updated

visitor.updated

You can subscribe to this event if you wish to be notified when a piece of visitor information is updated.

Case 1: You will receive this payload when lead information is updated.

Payload:
  1. {
  2.     "id": "30000000095001",
  3.     "type": "lead ",
  4.     "first_name": "Scott",
  5.     "last_name": "Smith",
  6.     "modifier": {
  7.         "type": "operator",
  8.         "email_id": "patricia@zylker.com",
  9.         "name": "patricia@zylker.com",
  10.         "id": "30000000099007"
  11.     }
  12. }
Case 2: You will receive this payload when contact information is added to a lead

Note: A lead will be converted as a contact when information such as email or phone is provided for the first time.

Payload:
  1. {
  2.     "id": "30000000095001",
  3.     "type": "contact",
  4.     "first_name": "Scott",
  5.     "last_name": "Smith",
  6.     "email_id": "scottsmith@zylker.com",
  7.     "phone": "9123459876",
  8.     "lead": {
  9.         "id": "30000000090034"
  10.     },
  11.     "modifier": {
  12.         "type": "operator",
  13.         "email_id": "patricia@zylker.com",
  14.         "name": "patricia@zylker.com",
  15.         "id": "30000000099007"
  16.     }
  17. }
Case 3: You will receive this payload when a contact's information is updated.

Payload:
  1. {
  2.     "id": "30000000095001",
  3.     "type": "contact",
  4.     "first_name": "Scott",
  5.     "last_name": "Smith",
  6.     "email_id": "scottsmith@zylker.com",
  7.     "phone": "91234598121",
  8.     "modifier": {
  9.         "type": "operator",
  10.         "email_id": "patricia@zylker.com",
  11.         "name": "patricia@zylker.com",
  12.         "id": "30000000099007"
  13.     }
  14. }

How can I set up Webhooks?

To setup webhooks,
  1. Inside the SalesIQ dashboard, navigate to Settings > Developers > Webhooks .
  2. Here, you can add portal-based and embed-based events through webhooks in the Administration and Data modules respectively. You will be notified to the specified URL when an event occurs.

How to add a portal-based webhook in the Administration module?

Inside the Administration module, you can create webhooks based on portal operations. On subscription, you will be notified every time a portal event occurs. To add a new webhook,
  1. Click Add .
  2. Enter the URL that has to be invoked.
  3. Choose the events that you want to associate with the webhook.

  1. Finally, click Create Webhook and your webhook will be created. 
  2. You will also be able to see the Webhook instructions here.


How to delete a portal-based webhook in the Administration Module?

To delete a webhook,
  1. In the dashboard, hover over the webhook that you want to delete and then click on the delete icon on the far right.

  1. A confirmation pop-up appears. Click Delete and the webhook will be deleted.

How to enable/disable a webhook in the Administration module?

To enable/disable a webhook,
  1. Click the toggle button that appears on the right end of each webhook.

How to add an embed-based webhook in the Data module?

Inside the Data module, you can create webhooks based on embed operations. On subscription, you will be notified every time an embed event occurs. To add a new webhook,
  1. Click  Add .
  2. Choose the SalesIQ app(s) that you want to create a webhook for.

  1. Enter the URL that has to be invoked.
  2. Choose the events that you want to associate with the webhook.

  1. Finally, click  Create Webhook  and your webhook will be created.
  2. You will also be able to see the Webhook instructions here.



How to delete an embed-based webhook in the Data Module?

To delete a webhook,
  1. In the dashboard, hover over the webhook that you want to delete and then click on the delete icon on the far right.

  1. A confirmation pop-up appears. Click Delete and the webhook will be deleted.


How to enable/disable a webhook in the Data module?

To enable/disable a webhook,
  1. Click the toggle button that appears on the right end of each webhook.

Dashboard:

Inside the webhook dashboard, you will be able to view the following details:
  1. Failures: The number of times the webhook has failed
  2. Last Triggered: When the webhook was last triggered
  3. App: A list of the apps the webhook is associated with