--- title: "Message" slug: "server-api-ticketing-message" updated: 2022-08-31T14:20:28Z published: 2022-08-31T14:20:28Z canonical: "developer.comm100.com/server-api-ticketing-message" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Message ## Message Message of the ticket. - `Message` - Message Manage - `GET ticketing/tickets/{id}/messages` - [Get the list of Message](/docs/server-api-ticketing-message#get-the-list-of-message) - `GET ticketing/messages/{id}` - [Get a single Message](/docs/server-api-ticketing-message#get-a-single-message) - `POST ticketing/messages` - [Create a new Message](/docs/server-api-ticketing-message#create-a-new-message) - `POST ticketing/messages/{id}:botIntent` - [Send bot intent.](/docs/server-api-ticketing-message#send-bot-intent) - `POST ticketing/messages/{id}:resend` - [Resend the Message](/docs/server-api-ticketing-message#resend-the-message) - `POST ticketing/messages:identify` - [Identify message](/docs/server-api-ticketing-message#identify-message) - `PUT ticketing/messages/{id}` - [Update the Message](/docs/server-api-ticketing-message#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[]](/docs/server-api-ticketing-message#messageattachment-json-format) | Reference to MessageAttachment. | | `messageDelivery` | [messageDelivery](/docs/server-api-ticketing-message#messagedelivery-json-format) | 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: [Message](/docs/server-api-ticketing-message#message-json-format) - #### 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](/docs/server-api-ticketing-message#message-json-format) - #### 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](/docs/server-api-ticketing-message#messagedelivery-json-format) | body | no | Delivery information of the message. | | `attachments` | [attachments[]](/docs/server-api-ticketing-message#messageattachment-json-format) | body | no | The list of message attachment. | - #### Response: [Message](/docs/server-api-ticketing-message#message-json-format) - #### 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: [Message](/docs/server-api-ticketing-message#message-json-format) - #### 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: [Message](/docs/server-api-ticketing-message#message-json-format) - #### 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](/docs/server-api-ticketing-message#messagedelivery-json-format) | body | no | Delivery information of the message. | - #### Response: [Message](/docs/server-api-ticketing-message#message-json-format) - #### 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 } } ```