The Comm100 Ticketing & Messaging Webhook supports both HTTP and HTTPS URLs. The purpose of the Webhook is to check the message sent by an agent for compliance. The Webhook sends the message body to an external API, which either approves or rejects this message. On approval, the message is sent to a contact or visitor. On rejection, the message remains in the replying area, along with a rejection reason on the Comm100 Agent Console.
You can send Webhook Post Body request via following ways:
- Default Webhook Post Body: Sends complete Webhook Post body including the additional post body JSON.
- Only Additional Post Body: Sends only the Additional Post Body JSON.
The data is in JSON format. Here is the introduction of JSON.
Default Webhook Post Body Request
Here is an example of Webhook Post Body request.
{
"siteId": 10001,
"channelAccountId": "2957c419-0b59-ed11-a83d-00155de0e608",
"channelId": "Email",
"ticketInfo": {
"id": 1327,
"subject": "Updates for you: 2 new notifications",
"assigneeType": "agent",
"assigneeId": "00000000-0000-0000-0000-000000000000",
"departmentAssigneeId": "00000000-0000-0000-0000-000000000000",
"contactOrVisitorType": "contact",
"contactOrVisitorId": "57ef305b-0d04-428b-b459-96b2d1748d90",
"contactLanguage": "en",
"agentLanguage": "",
"autoTranslationStatus": false,
"status": "pendingExternal",
"priority": "normal",
"isReadByAgent": true,
"isReadByContact": false,
"ifHasDraft": false,
"mergedToTargetId": 0,
"createdById": "00000000-0000-0000-0000-000000000000",
"createdByType": "system",
"createdTime": "2022-11-10T03:22:13.660Z",
"lastUpdatedTime": "2022-11-16T06:36:41.703Z",
"lastRepliedTime": "2022-11-16T06:36:41.586Z",
"lastRepliedById": "c1695883-74ca-4bcd-9705-8cfc57d72739",
"lastRepliedByType": "agent",
"lastStatusChangedTime": "2022-11-16T06:28:37.283Z",
"totalReplies": 5,
"resolvedTime": "1970-01-01T00:00:00.000Z",
"resolvedByType": "none",
"resolvedById": "00000000-0000-0000-0000-000000000000",
"reopenedTime": "1970-01-01T00:00:00.000Z",
"originalConversationId": "",
"channelId": "Email",
"channelAccountId": "2957c419-0b59-ed11-a83d-00155de0e608",
"lastMessageId": "09061f65-7f4f-4113-90bd-21f5377ced47",
"lastMessageChannelId": "Email",
"lastMessageChannelAccountId": "2957c419-0b59-ed11-a83d-00155de0e608",
"customFields": {
"8086c96675144efaa3140762462a62d8": "",
"3f1e866c53e64d90a2fac62f706f604b": null },
"tags": [],
"tagIds": [],
"isInRecycleBin": false,
"lastMessage": null,
"messages": null,
"noteMentions": [],
"contactOrVisitor": null,
"firstResponseTimeSpan": 0,
"responseTimeSpan": 0,
"resolvedTimeSpan": 0,
"responseCount": 0,
"replyingAgent": "agentOnly" },
"contactInfo": {
"id": "57ef305b-0d04-428b-b459-96b2d1748d90",
"name": "noreply@facebookmail.com",
"firstName": "",
"lastName": "",
"mergeToContactId": "00000000-0000-0000-0000-000000000000",
"createTime": "2022-04-23T07:06:57.000Z",
"lastUpdatedTime": "2022-04-23T07:06:57.000Z",
"contactIdentities": [
{
"id": "30a48df8-8290-40b0-9f14-ffce685beae4",
"contactId": "57ef305b-0d04-428b-b459-96b2d1748d90",
"contactIdentityType": "Email",
"value": "noreply@facebookmail.com",
"avatarUrl": "",
"infoUrl": "",
"displayName": "noreply@facebookmail.com",
"originalContactPageUrl": "",
"isDeleted": false }
],
"customFields": {
"description": "",
"alias": "",
"title": "",
"company": "",
"fax": "",
"phone": "",
"mailingaddress": "",
"city": "",
"stateorprovince": "",
"countryorregion": "",
"postalorzipcode": "",
"timezone": "" },
"isDeleted": false },
"eventInfo": {
"eventType": "WhenAgentReplied",
"payload": {
"replyMessageContent": "243234@#$#@$#%#$%#$",
"replyMessageTranslatedContent": "" }
}
Only Additional Post Body Request
In some cases, API only allows you to receive the payload of the Additional JSON body. By enabling this, you can remove the whole default JSON body and only send the Additional JSON body.
Here is an example of Only Additional Post Body request.
{
"eventInfo": {
"eventType": "WhenAgentReplied",
"payload": {
"replyMessageContent": "Yes.",
"replyMessageTranslatedContent": ""
}
},
"additional": "val"
}
Webhook Response Body for Approval
To approve this message, webhook reply with a JSON payload which include:
{
"result": "approved"
}
Webhook Response Body for Rejection
To reject this message, webhook reply with a JSON payload which include:
{
"result": "rejected",
"rejectReason": "xxx" //the reject reason to show in Agent Console
}