Skip to main content

Webhook

COTWebhook

Description

Webhooks are set up to send specified event data to an indicated server. When the specified event occurs, the webhook trigger is activated, and the event's data is sent to the server. Webhooks can be triggered by user, task, survey, elements, or user logout events.

A webhook's configuration is stored within a COTWebhook object. The COTWebhook contains the webhook's name, information regarding the triggering event, and the server URL to which the data is sent.

JSON Sample:

{
"_id": "62685990d918fb5557f9f992",
"company": "625be93a286ef83c1c0e845f",
"isActive": true,
"trigger": "create-edit-delete-task",
"url": "https://www.server.com",
"name": "Work Orders Update",
"code": "wo_update",
"context": {
"survey": "",
"group": "",
"taskGroup": "6261612a8f1e99002e5c8cce"
},
"__v": 0,
"description": "Sends updates on Work Orders"
}
FieldDescriptionTypeNotes
_idThe webhook's ObjectId. The ObjectId is used to identify the webhook.ObjectId<COTWebhook>
companyIndicates the ObjectId of the company in which the webhook is found in.ObjectId<COTCompany>
isActiveIndicates whether the webhook is active or not.boolean
triggerSpecifies the type of event that triggers the webhook. Triggers can be set to go off when a user, task, survey, property, or note is created, modified, or deactivated. User logouts can also be set as triggers.

Options are:
create-edit-delete-user
create-edit-delete-task
create-edit-delete-survey
create-edit-delete-property
- create-edit-delete-note
logout-user
stringSome triggers can be configured with special pararmeters. See the contexts field for details.
urlIndicates the URL address of the server to which the event data is sent.stringServer URLs are provided by external systems or third-parties.
nameIndicates the webhook's name.stringWe recommend using a descriptive name for the webhook.
codeIndicates the webhook's identification code. The code must be unique. Only lowercase letters, numbers, and underscores can be used.string
contextContains the event trigger's details. The fields used will depend on the selected event type.object
context.surveyContains the ObjectId of the survey to be monitored.ObjectId<COTSurvey>This field is left with empty quotes when the trigger is not a survey.
context.groupIndicates the ObjectId of the group in which the survey to be monitored is found in.ObjectId<COTGroup>This field is left with empty quotes when the trigger is not a survey.
context.taskGroupThis is the ObjectId of the task group in which tasks will be monitored.ObjectId<COTTaskGroup>This field is left with empty quotes when the trigger is not a task.

Additional Resources

Help