--- title: "Junk" slug: "server-api-ticketing-junk" updated: 2022-06-16T07:30:23Z published: 2022-06-16T07:30:24Z canonical: "developer.comm100.com/server-api-ticketing-junk" --- > ## 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. # Junk ## Junk Ticket junk email. - `Junk` - Junk Manage - `GET ticketing/junks` - [Get the list of Junk](/docs/server-api-ticketing-junk#get-the-list-of-junk) - `GET ticketing/junks/{id}` - [Get a single Junk](/docs/server-api-ticketing-junk#get-a-single-junk) - `POST ticketing/junks` - [Create a new Junk](/docs/server-api-ticketing-junk#create-a-new-junk) - `POST ticketing/junks/{id}:notJunk` - [Set the junk as a normal message.](/docs/server-api-ticketing-junk#set-the-junk-as-a-normal-message.) - `POST ticketing/junks/{id}:read` - [Set the junk as read.](/docs/server-api-ticketing-junk#set-the-junk-as-read.) - `POST ticketing/junks/{id}:unread` - [Set the junk as unread.](/docs/server-api-ticketing-junk#set-the-junk-as-unread.) - `PUT ticketing/junks/{id}` - [Update the Junk](/docs/server-api-ticketing-junk#update-the-junk) - `DELETE ticketing/junks/{id}` - [Remove the Junk](/docs/server-api-ticketing-junk#remove-the-junk) ### Junk JSON Format Junk is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the junk message. | | `time` | datetime | Time when receiving the junk message. | | `isReadByAgent` | bool | Whether the junk message is read by agent or not. | | `sentById` | guid | Id of contact or visitor. | | `sentByType` | string | Type of the sender. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent". | | `type` | string | Type of the junk. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView". | | `metadata` | object | Message metadata, Json format. | | `channelId` | string | Id of the channel. | | `body` | string | Content of the junk. | | `attachments` | [attachments[]](/docs/server-api-ticketing-junk#junkattachment-json-format) | Reference to JunkAttachment. | ### JunkAttachment JSON Format: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the attachment. | | `junkId` | guid | Id of the junk ticket 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 the list of Junk `GET ticketing/junks` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `time` | string | query | no | Filter by time. | | `include` | string | query | no | Allowed values are "ticketingJunkAttachment", "sentBy". | - #### Response: An array of [Junk](/docs/server-api-ticketing-junk#junk-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/ticketing/junks \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "junks": [ { "id": "0a5b1872-37c6-4599-92a6-ec00eb208450", "time": "2021-04-28T01:16:05.013Z", "isReadByAgent": false, "sentById": "c1679e57-7b10-4343-a987-ae3c846c2227", "sentByType": "contact", "type": "html", "metadata": { "channel": { "channelAccount": "6de84bfc-d1c1-eb11-aacf-06c7a219a2ac", "isFromChannelToPlatform": true, "accountName": "test@163.com" }, "source": { "authorId": "test@163.com", "messageUrl": "", "name": "test@163.com", "contactIdentityId": "a07ff412-ace2-4e42-baea-de94bf26869a", "originalParentId": "", "conversationId": "" }, "decoration": { "email": { "from": "test@163.com", "to": "\"agent\" ```