Articles in this section
Category / Section

Activity Webhook

Published:
New

Use case overview

By creating a webhook, the activity fields can be sent as payload to an API or an HTTP request-catching application in real-time.

How does it work?

An activity webhook can be triggered based on events of an activity. To learn more about activity events captured by webhook, refer to this link.

Activity payload

When creating a webhook, you have the option to send activity data in two formats:

  1. Default - Sends the activity fields in a predefined structure.
  2. Advanced - Allows for customization of the payload structure, which is often framed in JSON format.

Picture3.png

To learn more about webhook creation and its features, refer to this link. The activity fields available to choose under default and advanced options are as follows:

S. No Default fields Properties Placeholders in Advanced option
1. Activity ID - {{activity.ActivityId}}
2. Subject - {{activity.Subject}}
3. Type ID,
Name
{{activity.Type.Id}}
{{activity.Type.Name}}
4. Status ID,
Name
{{activity.Status.Id}}
{{activity.Status.Name}}
5. Description - {{activity.Description}}
6. Description Text - {{activity.DescriptionText}}
7. Created By User ID,
Email ID
{{activity.CreatedBy.UserId}}
{{activity.CreatedBy.EmailId}}
8. Creation Time - {{activity.CreatedTime}}
9. Watchers User ID,
Email ID
{{activity.Watchers.UserId}}
{{activity.Watchers.EmailId}}
10. Last Modified By User ID,
Email ID
{{activity.LastModifiedBy.UserId}}
{{activity.LastModifiedBy.EmailId}}
11. Last Modified Time - {{activity.LastModifiedTime}}
12. Last Comment ID,
Description,
CreatedBy user ID,
User type name
{{activity.LastComment}}
13. Last Comment Html - {{activity.LastCommentHtml}}
14. Last Comment Text - {{activity.LastCommentText}}
15. Linked Ticket Ticket ID,
Ticket Status -
   ID,
   Name
Ticket Subject,
Ticket Assignee -
   User ID,
   Email ID,
   Name,
   Display Name
Ticket Requester -
   User ID,
   Email ID,
   Name,
   Display Name
{{activity.LinkedTicket.TicketId}}
{{activity.LinkedTicket.TicketStatus.Id}}
{{activity.LinkedTicket.TicketStatus.Name}}
{{activity.LinkedTicket.TicketSubject}}
{{activity.LinkedTicket.TicketAssignee.UserId}}
{{activity.LinkedTicket.TicketAssignee.EmailId}}
{{activity.LinkedTicket.TicketAssignee.Name}}
{{activity.LinkedTicket.TicketAssignee.DisplayName}}
{{activity.LinkedTicket.TicketRequester.UserId}}
{{activity.LinkedTicket.TicketRequester.EmailId}}
{{activity.LinkedTicket.TicketRequester.Name}}
{{activity.LinkedTicket.TicketRequester.DisplayName}}
16. Linked User User ID,
Email ID,
Name,
Display Name
{{activity.LinkedUser.UserId}}
{{activity.LinkedUser.EmailId}}
{{activity.LinkedUser.Name}}
{{activity.LinkedUser.DisplayName}}
17. Assignee User ID,
Email ID,
Name,
Display Name
{{activity.Assignee.UserId}}
{{activity.Assignee.EmailId}}
{{activity.Assignee.Name}}
{{activity.Assignee.DisplayName}}
18. Due date - {{activity.DueDate}}
19. Priority ID,
Name
{{activity.Priority.Id}}
{{activity.Priority.Name}}
20. Start Date - {{activity.StartDate}}
21. End Date - {{activity.EndDate}}
22. Time Zone ID,
Name
{{activity.TimeZone.Id}}
{{activity.TimeZone.Name}}
23. Collaborators User ID,
Email ID
{{activity.Collaborators.UserId}}
{{activity.Collaborators.EmailId}}
24. Duration - {{activity.Duration}}
25. To Email - {{activity.ToEmail}}
26. CC Email - {{activity.CcEmail}}
27. Ticket update ID - {{activity.TicketUpdateId}}

Comment fields such as Last Comment, Last Comment Text, and Last Comment Html have values exclusively when the webhook captures a Comment Created event. Otherwise, these fields will be null.

Trigger activity webhook conditionally

S. No Condition Operator Value Description
1. Activity Type Is
In
Task
Call
Meeting
Forward
And other custom types
Make webhook to capture activity events from a specific activity type.

Screenshot_2024-03-13_113058.png

To learn more about activity types, refer to this link.

Sample payload

Default option

When all fields are included, the payload sent for an Updated event might resemble the below,

{
 "eventModule": "Activity",
 "eventType": "ActivityUpdated",
 "eventTime": "2020-03-01T09:03:02.1184887Z",
 "orgId": 1,
 "orgName": "Connect HQ",
 "payload": {
   "watchers": [
     {
       "userId": 321,
       "emailId": "james.anderson@org.com"
     },
     {
       "userId": 231,
       "emailId": "michelle.huntsman@org.com"
     }
   ],
   "type": {
     "id": 1,
     "name": "Task"
   },
   "toEmail": null,
   "timeZone": null,
   "ticketUpdateId": null,
   "subject": "Conduct activities for team interaction",
   "status": {
     "id": 1,
     "name": "Open"
   },
   "startDate": null,
   "priority": {
     "id": 2,
     "name": "Normal"
   },
   "linkedUser": {
     "userId": 2161,
     "emailId": "sasha.garcia@org.com",
     "name": "Sasha",
     "displayName": "Sasha sass"
   },
   "linkedTicket": {
     "ticketId": 15621,
     "ticketStatus": {
       "id": 2,
       "name": "Open"
     },
     "ticketSubject": "Requesting weekly stress relief activities",
     "ticketAssignee": {
       "userId": 421,
       "emailId": "paul.robinson@org.com",
       "name": "Paul",
       "displayName": "Paul rocks"
     },
     "ticketRequester": {
       "userId": 143,
       "emailId": "videl.rodriguez@org.com",
       "name": "Videl",
       "displayName": "Angel videl"
     }
   },
   "lastModifiedTime": "2020-11-06T09:02:59.074245Z",
   "lastModifiedBy": {
     "userId": 430,
     "emailId": "dusk.moore@org.com"
   },
   "lastCommentText": null,
   "lastCommentHtml": null,
   "lastComment": null,
   "endDate": null,
   "duration": null,
   "dueDate": "2020-11-12T18:30:00Z",
   "descriptionText": "Create a list of interactive activities and prepare a schedule\r\n\r\n",
   "description": "<p>Create a list of interactive activities and prepare a schedule</p>",
   "createdTime": "2020-10-17T06:15:07.977519Z",
   "createdBy": {
     "userId": 111,
     "emailId": "gabriel.livingstone@org.com"
   },
   "collaborators": null,
   "ccEmail": null,
   "assignee": {
     "userId": 909,
     "emailId": "aryan.suryakumar@org.com",
     "name": "Aryan",
     "displayName": "Arya"
   },
   "activityId": 1121
 },
 "changeLog": [
   {
     "fieldName": "Assignee",
     "fieldApiName": "activityAgent",
     "newValue": 909,
     "newString": "Aryan",
     "oldValue": 890,
     "oldString": "Sarah"
   }
 ]
}

A change log will be sent with the payload only for the Updated event, and this will happen if the updated field is chosen to be included in the payload. For example, in the above scenario, the assignee change log is attached because it was received for a change in the assignee, which qualifies as an Updated event, and the assignee field is expected to be in the payload.

Advanced option

The Custom Payload text area available under the advanced option lets you input your customized payload and insert preferred activity data from the placeholder section.
This section appears when you click on Insert Placeholders.

Picture1.png

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied