From 7c9b895675b8dcbf18face9d68f94dd14190f764 Mon Sep 17 00:00:00 2001 From: Preslav Mihaylov Date: Mon, 9 Dec 2024 11:36:29 +0200 Subject: [PATCH] add docs about chat_received webhook (#148) * add docs about chat_received webhook * lint * Update _snippets/webhooks/thread-chat-received.mdx Co-authored-by: David Leyland * Update api-reference/webhooks/thread-chat-received.mdx Co-authored-by: Mathias Vagni --------- Co-authored-by: David Leyland Co-authored-by: Mathias Vagni --- _snippets/webhooks/thread-chat-received.mdx | 103 ++++++++++++++++++ .../webhooks/thread-chat-received.mdx | 13 +++ mint.json | 1 + 3 files changed, 117 insertions(+) create mode 100644 _snippets/webhooks/thread-chat-received.mdx create mode 100644 api-reference/webhooks/thread-chat-received.mdx diff --git a/_snippets/webhooks/thread-chat-received.mdx b/_snippets/webhooks/thread-chat-received.mdx new file mode 100644 index 0000000..9d6f2cc --- /dev/null +++ b/_snippets/webhooks/thread-chat-received.mdx @@ -0,0 +1,103 @@ +```json +{ + "timestamp": "2023-11-02T15:32:28.831Z", + "workspaceId": "w_01GST0W989ZNAW53X6XYHAY87P", + "payload": { + "eventType": "thread.chat_received", + "chat": { + "timelineEntryId": "t_01HE8AM6GZG6C3CM344HFDM3J3", + "id": "ch_01HE8AM6GZPZ3Q3RBEVE5TZ80X", + "customerReadAt": null, + "attachments": [], + "text": "You are welcome!", + "createdAt": "2023-11-02T15:32:28.831Z", + "createdBy": { + "actorType": "customer", + "userId": "c_01HDRC3CJHBWBAAF4K63Z11XZ5" + }, + "updatedAt": "2023-11-02T15:32:28.831Z", + "updatedBy": { + "actorType": "customer", + "userId": "c_01HDRC3CJHBWBAAF4K63Z11XZ5" + } + }, + "thread": { + "id": "th_01HDRC3CRY6ESPZJ7FZCTRQWYH", + "customer": { + "id": "c_01HDRC3CJHBWBAAF4K63Z11XZ5", + "email": { + "email": "peter@example.com", + "isVerified": false, + "verifiedAt": null + }, + "externalId": null, + "fullName": "Peter Santos", + "shortName": "Peter", + "markedAsSpamAt": null, + "markedAsSpamBy": null, + "customerGroupMemberships": [], + "createdAt": "2023-10-27T10:50:24.209Z", + "createdBy": { + "actorType": "system", + "system": "email_inbound_handler" + }, + "updatedAt": "2023-11-02T08:57:32.944Z", + "updatedBy": { + "actorType": "user", + "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" + } + }, + "title": "Unable to tail logs", + "previewText": "Hey, I am currently unable to tail the logs of the service svc-8af1e3", + "priority": 2, + "externalId": null, + "status": "TODO", + "statusChangedAt": "2023-11-02T08:57:32.943Z", + "statusChangedBy": { + "actorType": "user", + "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" + }, + "statusDetail": null, + "assignee": null, + "assignedAt": null, + "labels": [], + "firstInboundMessageInfo": { + "timestamp": "2023-10-27T10:50:24.323Z", + "messageSource": "CHAT" + }, + "firstOutboundMessageInfo": { + "timestamp": "2023-10-27T10:50:52.944Z", + "messageSource": "CHAT" + }, + "lastInboundMessageInfo": { + "timestamp": "2023-10-27T15:05:30.223Z", + "messageSource": "CHAT" + }, + "lastOutboundMessageInfo": { + "timestamp": "2023-10-27T15:04:49.521Z", + "messageSource": "CHAT" + }, + "supportEmailAddresses": ["help@example.com"], + "createdAt": "2023-10-27T10:50:24.323Z", + "createdBy": { + "actorType": "system", + "system": "email_inbound_handler" + }, + "updatedAt": "2023-11-02T08:57:32.943Z", + "updatedBy": { + "actorType": "user", + "userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" + } + } + }, + "id": "pEv_01HE8AM6GZVS1S3609PFGR30FE", + "webhookMetadata": { + "webhookTargetId": "whTarget_01HD4400VTDJQ646V6RY37SR7K", + "webhookTargetVersion": "2024-09-18", + "webhookDeliveryAttemptId": "whAttempt_01HE8ANGEGVQVTCY3DD30CZ8G4", + "webhookDeliveryAttemptNumber": 1, + "webhookDeliveryAttemptTimestamp": "2023-11-02T15:33:11.760Z" + }, + "type": "thread.chat_received" +} +``` diff --git a/api-reference/webhooks/thread-chat-received.mdx b/api-reference/webhooks/thread-chat-received.mdx new file mode 100644 index 0000000..af56e49 --- /dev/null +++ b/api-reference/webhooks/thread-chat-received.mdx @@ -0,0 +1,13 @@ +--- +title: 'Chat received' +--- + +This event is fired when a chat message from a customer is received. + +## Schema + +[**View JSON Schema →**](https://core-api.uk.plain.com/webhooks/schema/latest.json) + +Example: + + diff --git a/mint.json b/mint.json index 699d006..8b293f5 100644 --- a/mint.json +++ b/mint.json @@ -271,6 +271,7 @@ "api-reference/webhooks/thread-slack-message-received", "api-reference/webhooks/thread-slack-message-sent", "api-reference/webhooks/thread-chat-sent", + "api-reference/webhooks/thread-chat-received", "api-reference/webhooks/thread-field-created", "api-reference/webhooks/thread-field-updated", "api-reference/webhooks/thread-field-deleted",