Message
- 31 Aug 2022
- 7 Minutes to read
- Print
- DarkLight
Message
- Updated on 31 Aug 2022
- 7 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Message
Message of the ticket.
Message
- Message ManageGET ticketing/tickets/{id}/messages
- Get the list of MessageGET ticketing/messages/{id}
- Get a single MessagePOST ticketing/messages
- Create a new MessagePOST ticketing/messages/{id}:botIntent
- Send bot intent.POST ticketing/messages/{id}:resend
- Resend the MessagePOST ticketing/messages:identify
- Identify messagePUT ticketing/messages/{id}
- Update the Message
Message JSON Format
Message is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
id | guid | Id of the message. |
ticketId | int | 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". |
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. |
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. |
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://api11.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"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,
"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. |
include | string | query | no | Allowed values are "ticketingMessageAttachment", "ticketingMessageDelivery", "sentBy". |
Response:
An array of Message
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/tickets/3b6560d4-0f10-4652-a376-e590936d290e/messages \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
[
{
"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,
"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 |
---|---|---|---|---|
ticketId | int | body | yes | Auto Increment 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". |
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. |
messageDelivery | messageDelivery | body | no | Delivery information of the message. |
attachments | attachments[] | body | no | The list of message attachment. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/messages \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"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,"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
{
"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,
"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
}
}
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://api11.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
Resend the Message
POST ticketing/messages/{id}:resend
Parameters:
No Parameters
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e:resend \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"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,
"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
}
}
Identify 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://api11.comm100.io/v4/ticketing/messages:identify \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"originalId":"7bf5bad7-dee7-438a-a943-bdb3fbcf376f","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
}
Update the Message
PUT ticketing/messages/{id}
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
metadata | object | body | yes | Message metadata, Json format. |
originalId | string | body | no | Id in original channel. |
messageDelivery | messageDelivery | body | no | Delivery information of the message. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/messages/3b6560d4-0f10-4652-a376-e590936d290e \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"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","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
{
"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,
"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
}
}
Was this article helpful?