Message

Message of the ticket.

Message
- Message Manage
GET ticketing/messages/{id}
GET ticketing/tickets/{id}/messages
POST ticketing/messages
POST ticketing/messages:identify
POST ticketing/messages/{id}:botIntent
POST ticketing/messages/{id}:identify
POST ticketing/messages/{id}:resend
PUT ticketing/messages/{id}
Model
Message JSON Format

Message is represented as simple flat JSON objects with the following keys:

Name Type Description
translatedBody string
id guid Id of the message.
ticketId selfIncrementId Id of the ticket which the message belongs to.
parentId guid Id of current message's parent.
sentById guid Id of the message sender.
sentByType string Role of the sender. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent", "outreachCampaign".
time datetime Time when the message was created.
type string Type of message content. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView".
metadata object Message metadata, Json format.
originalId string Id in original channel.
channelId string Name of the message channel.
body string Content of the message. You can pass both plaintext and base64 encoded text. If the request containing plaintext is blocked by comm100 WAF, use base64 format. When using base64, add "data:text/plain;base64," before the content.
ifDisplayInTicketCorrespondences bool Whether a trigger email should be included within a ticket's correspondence thread or not.
isOriginalSentToContact bool
showInlineImage bool
isRead bool
isInternal bool
attachments attachments[] Reference to MessageAttachment.
messageDelivery messageDelivery Reference to MessageDelivery.

MessageDelivery JSON Format:

Name Type Description
messageId guid Id of the message which the delivery belongs to.
status string Status of the delivery. Allowed values are "waitForSending", "sending", "failed", "success".
failReason string Reason why the delivery failed.
time datetime Time when message was delivered.
groupId guid The Id of the message group, it is used for bot message, it should be delivered in a group and one by one in order.
orderNum integer Order of the delivery.

MessageAttachment JSON Format:

Name Type Description
id guid Id of the attachment.
messageId guid Id of the message which the attachment belongs to.
fileKey string Unique key in file service.
name string Name of the attachment.
size integer Size of the attachment.
type string Type of the attachment. Allowed values are "video", "audio", "image", "file".
url string Download URL of the attachment.
Endpoint
Get a single Message

GET ticketing/messages/{id}

Parameters:
Name Type In Required Description
include string query no Allowed values are "ticketingMessageAttachment", "ticketingMessageDelivery", "sentBy".
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}
Get the list of Message

GET ticketing/tickets/{id}/messages

Parameters:
Name Type In Required Description
ticketId selfIncrementId query yes Filter by ticket id.
notSentById guid query no Filter by sender.
time DateTime query no Fiter by time.
include string query no Allowed values are "ticketingMessageAttachment", "ticketingMessageDelivery", "sentBy".
Response:

An array of   Message

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/tickets/3b6560d4-0f10-4652-a376-e590936d290e/messages \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

[{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}]
Create a new Message

POST ticketing/messages

Parameters:
Name Type In Required Description
translatedBody string body no
ticketId selfIncrementId body yes Id of the ticket which the message belongs to.
parentId guid body no Id of current message's parent.
sentById guid body yes Id of the message sender.
sentByType string body yes Role of the sender. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent", "outreachCampaign".
time datetime body no Time when the message was created.
type string body yes Type of message content. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView".
metadata object body yes Message metadata, Json format.
originalId string body no Id in original channel.
channelId string body yes Name of the message channel.
body string body no Content of the message. You can pass both plaintext and base64 encoded text. If the request containing plaintext is blocked by comm100 WAF, use base64 format. When using base64, add "data:text/plain;base64," before the content.
ifDisplayInTicketCorrespondences bool body no Whether a trigger email should be included within a ticket's correspondence thread or not.
isOriginalSentToContact bool body no
showInlineImage bool body no
isRead bool body no
isInternal bool body no
messageDelivery messageDelivery body no Delivery information of the message.
attachments attachments[] body no The list of message attachment.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"translatedBody":"","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"messageDelivery":{"status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0},"attachments":[{"fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}'

Response:

 HTTP/1.1 201 Created

{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}
Identity message

POST ticketing/messages:identify

Parameters:

Name Type In Required Description
originalId string body yes Original Id of message.
channelId string body yes Channel Id of message.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages:identify \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"originalId":"original id 32033","channelId":"email"}'

Response:

 HTTP/1.1 200 OK

{"id": "a92ba29a-722b-48f6-9038-7e3ed2059b99", "ticketId": 2860, "parentId": "00000000-0000-0000-0000-000000000000", "sentById": "902f53f4-4acc-4103-8e85-fd20e7678edd", "sentByType": 3, "time": "2021-05-08T13:12:49.88Z", "body": "message content", "type": 2, "metadata": { "channel": { "channelAccount": "bed5c210-e6ae-eb11-8105-00155d081d0b", "isFromChannelToPlatform": true, "accountName": "frank@comm100.com" }, "source": { "authorId": "frank@comm100.com", "messageUrl": "", "name": "frank@comm100.com", "contactIdentityId": "066ddbb7-6009-47f2-8f45-00241bbbf018", "conversationId": "" }, "decoration": { "email": { "from": "frank@comm100.com", "to": "test4@comm100.com", "cc": "", "bcc": "", "subject": "111", "quote": "", "ifHasAttachmentNotReceived": false } } }, "originalId": "7bf5bad7-dee7-438a-a943-bdb3fbcf376f", "channelId": "Email", "attachments": [], "sentBy": {}, "ifDisplayInTicketCorrespondences": true }
Send bot intent.

POST ticketing/messages/{id}:botIntent

Parameters:

Name Type In Required Description
botId guid body yes Id of the bot.
channelId string body yes Id of the channel.
intentId guid body yes Id of the intent.
metadata json body yes Message metadata, Json format.
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages/11:botIntent \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{ "botId": "af2aee4e-ec78-42d2-9360-292672591586", "channelId": "FacebookMessenger", "intentId": "5380b2d2-eb96-4b9a-a959-68b77764e9ac", "metadata": { "channel": { "accountName": "my space", "channelAccount": "92920f2f-01c0-4151-bd7c-c0f9bf8c565b" }, "source": { "name": "Yu", "contactIdentityId": "cace9f1f-40f7-4f62-adc9-987eb121392a" } } } '

Response:

 HTTP/1.1 200 OK

Identify the Message

POST ticketing/messages/{id}:identify

Parameters:
No Parameters
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e:identify \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}
Resend the Message

POST ticketing/messages/{id}:resend

Parameters:
No Parameters
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e:resend \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}
Update the Message

PUT ticketing/messages/{id}

Parameters:
Name Type In Required Description
translatedBody string body no
metadata object body yes Message metadata, Json format.
originalId string body no Id in original channel.
isOriginalSentToContact bool body no
showInlineImage bool body no
isRead bool body no
isInternal bool body no
messageDelivery messageDelivery body no Delivery information of the message.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"translatedBody":"","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"messageDelivery":{"status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0},"attachments":[{"fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}'

Response:

 HTTP/1.1 200 OK

{"translatedBody":"","id":"3b6560d4-0f10-4652-a376-e590936d290e","ticketId":"100","parentId":"ef50cc68-5b88-4405-88f0-84334581246d","sentById":"31cb8d70-b5a6-4faa-b021-62335d6dcf6c","sentByType":"visitor","time":"2021-04-26T10:52:24.336Z","type":"text","metadata":{"channel":{"channelAccount":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","isFromChannelToPlatform":true},"source":{"contactIdentityId":"b293de41-e8a5-46b5-98dc-f8db9e5e6518","conversationId":"1848"},"decoration":{"chat":{"title":"Chat Transcript with 1"},"offlineMessage":{"title":"Chat Transcript with 1"}}},"originalId":"96e7964a-29cb-40d6-8251-4f334b5748bd","channelId":"Email","body":"data:text/plain;base64,PHA+MTExPC9wPg==","ifDisplayInTicketCorrespondences":true,"isOriginalSentToContact":true,"showInlineImage":true,"isRead":true,"isInternal":true,"attachments":[{"id":"8c0136f3-9dd3-47f3-be12-81b232c84408","messageId":"3b6560d4-0f10-4652-a376-e590936d290e","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}],"messageDelivery":{"messageId":"3b6560d4-0f10-4652-a376-e590936d290e","status":"failed","failReason":"something is wrong.","time":"2021-04-26T10:52:24.336Z","groupId":"8c0136f3-9dd3-47f3-be12-81b232c84408","orderNum":0}}