Using webhooks
6 min
Criado por Knowledge Engineering Team em 04/12/2020 17:05

On this page

Setting up a Movidesk webhook

JSON data packet

Understanding the Webhook execution log

 

Webhook triggers can be used to send data about a ticket to another system when certain conditions are met. This is often a simpler alternative to a two way API based setup, as the other system does not need to send an API request to prompt Movidesk to send the information.

If you have not read the Introduction to triggers and Triggers for tickets articles, we strongly recommend reading those articles first. They will cover basic concepts, terminology, and provide details on how to configure trigger conditions, which will be necessary for understanding how to set up a webhook trigger.

 

Glossary

REST API –Interface following standard framework that allows different systems to communicate over the web

POST method – REST API request for the server to accept the transmitted data

Data packet – A unit of data containing information formatted for transmission

JSON – Standard file format for data transmission

 

Setting up a Movidesk webhook

To create a webhook, go to Configurations > Triggers and create a trigger of the type Ticket. Following the same process outlined in the trigger articles, configure the trigger conditions to suit the scenario where you want the webhook to be executed.

Select the Trigger webhook action and enter the URL you want the system to send the POST request to. The POST request will contain the JSON data packet with information about the ticket.

Head with gears

Tip You can also add other actions to a webhook trigger, for example to add a note communicating the ticket information was sent to another system. These actions will also be executed when the webhook trigger fires.

 

You will also need to configure the system receiving the data from Movidesk so that it can accept the POST request and handle the data.

 

JSON data packet

When the trigger fires, the webhook will send a POST request to the specified URL containing a JSON data packet about the ticket.

Value or object

Description

Id

ID of the object, either the ticket ID or note ID

Subject

Ticket subject

Status

Ticket status

Justification

Ticket status reason, if it has one

Urgency

Ticket priority

ServiceFirstLevel

Specific service selected on the ticket

Actions

Objects for ticket notes

Description

Plain note text

HtmlDescription

HTML code of the note text

Attachments

Objects for ticket note attachments

FileName

Name of the attachment file

Path

Internal system path to the attachment file

CreatedBy

Objects for the person that created the parent object

PersonType

Type of the person

  • 1 = User
  • 2 = Company
  • 4 = Department

ProfileType

Profile type of the person

  • 1 = Agent
  • 2 = Customer
  • 3 = Agent and Customer

BusinessName

Name of the user, or trade name of the organization

Email

Main email of the person

Phone

Main phone number of the person

CreatedDate

UTC date time when the object was created

ResolvedInFirstCall

Returns true for first call resolutions (FCR) and false if it was not a first call resolution

SlaSolutionTime

Time in minutes between ticket creation and ticket resolution due date

 

The JSON data packet will follow the structure below:

{

 Id: int,

 Subject: string,

 Status: string,

 Justification: string,

 Actions:

 [

 {

 Id: int,

 Description: string,

 HtmlDescription: string,

 Attachments:

 [

 {

 FileName: string,

 Path: string,

 CreatedBy:

 {

 Id: string,

 PersonType: PersonType,

 ProfileType: ProfileType,

 BusinessName: string,

 Email: string,

 Phone: string

 },

 CreatedDate: DateTime

 }

 ]

 }

 ],

 WebhookEvents:

 [

 {

 Criteria: ConditionCriteriaId,

 Operator: ConditionOperatorId

 }

 ],

 Urgency: string,

 ServiceFirstLevel: string,

 CustomFieldValues:

 [

 {

 CustomFieldId: int,

 CustomFieldRuleId: int,

 Line: int,

 Value: string,

 Items:

 [

 PersonId string,

 ClientId: string,

 Team: string,

 CustomFieldItem: string,

 StorageFileGuid: string,

 FileName: string

 ]

 }

 ],

 SlaSolutionTime = int

}

 

Understanding the Webhook execution log

To see a list of all webhook execution attempts, go to Configurations > Webhook execution log. This is a log of every time a trigger with the Trigger webhook action fired. You can filter the log by date, ticket number, and error message.

This log is particularly useful when testing a new webhook or troubleshooting. For example, it allows you to see if the other system did not accept the POST request and returned an error.

 

 

Classifique este artigo
Últimos artigos visitados