Junk

Ticket junk email.

Junk
- Junk Manage
GET ticketing/junks
GET ticketing/junks/{id}
POST ticketing/junks
POST ticketing/junks/{id}:notJunk
POST ticketing/junks/{id}:read
POST ticketing/junks/{id}:unread
PUT ticketing/junks/{id}
DELETE ticketing/junks/{id}
Model
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", "outreachCampaign".
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[] 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.
Endpoint
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

Example

Sample Request:

curl https://api15.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\" <agent@comm100.com>","cc":"","bcc":"","subject":"junk msg","quote":"","ifHasAttachmentNotReceived":false}}},"channelId":"Email","body":"junk body","attachments":[{"id":"3b6560d4-0f10-4652-a376-e590936d290e","junkId":"0a5b1872-37c6-4599-92a6-ec00eb208450","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}],"nextPage":null,"previousPage":null,"total":1}
Get a single Junk

GET ticketing/junks/{id}

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

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/0a5b1872-37c6-4599-92a6-ec00eb208450 \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 200 OK

{"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\" <agent@comm100.com>","cc":"","bcc":"","subject":"junk msg","quote":"","ifHasAttachmentNotReceived":false}}},"channelId":"Email","body":"junk body","attachments":[{"id":"3b6560d4-0f10-4652-a376-e590936d290e","junkId":"0a5b1872-37c6-4599-92a6-ec00eb208450","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}
Create a new Junk

POST ticketing/junks

Parameters:
Name Type In Required Description
time datetime body no Time when receiving the junk message.
isReadByAgent bool body no Whether the junk message is read by agent or not.
sentById guid body yes Id of contact or visitor.
sentByType string body yes Type of the sender. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent", "outreachCampaign".
type string body yes Type of the junk. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView".
metadata object body no Message metadata, Json format.
channelId string body yes Id of the channel.
body string body no Content of the junk.
attachments attachments[] body no Attachment in junk message.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"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\" <agent@comm100.com>","cc":"","bcc":"","subject":"junk msg","quote":"","ifHasAttachmentNotReceived":false}}},"channelId":"Email","body":"junk body","attachments":[{"fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}'

Response:

 HTTP/1.1 201 Created

{"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\" <agent@comm100.com>","cc":"","bcc":"","subject":"junk msg","quote":"","ifHasAttachmentNotReceived":false}}},"channelId":"Email","body":"junk body","attachments":[{"id":"3b6560d4-0f10-4652-a376-e590936d290e","junkId":"0a5b1872-37c6-4599-92a6-ec00eb208450","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}
Set the junk as a normal message.

POST ticketing/junks/{id}:notJunk

Parameters:

No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/19187aa8-eea1-4c06-bf8c-cc91bfff666a:notJunk \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \

Response:

 HTTP/1.1 200 OK

Set the junk as read.

POST ticketing/junks/{id}:read

Parameters:

No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/19187aa8-eea1-4c06-bf8c-cc91bfff666a:read \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \

Response:

 HTTP/1.1 200 OK

Set the junk as unread.

POST ticketing/junks/{id}:unread

Parameters:

No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/19187aa8-eea1-4c06-bf8c-cc91bfff666a:unread \
-X 'POST' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \

Response:

 HTTP/1.1 200 OK

Update the Junk

PUT ticketing/junks/{id}

Parameters:
Name Type In Required Description
isReadByAgent bool body no Whether the junk message is read by agent or not.
Response:
Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/0a5b1872-37c6-4599-92a6-ec00eb208450 \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"isReadByAgent":false,"attachments":[{"fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}'

Response:

 HTTP/1.1 200 OK

{"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\" <agent@comm100.com>","cc":"","bcc":"","subject":"junk msg","quote":"","ifHasAttachmentNotReceived":false}}},"channelId":"Email","body":"junk body","attachments":[{"id":"3b6560d4-0f10-4652-a376-e590936d290e","junkId":"0a5b1872-37c6-4599-92a6-ec00eb208450","fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"type":"file","url":"http://myfile/url"}]}
Remove the Junk

DELETE ticketing/junks/{id}

Parameters:
No Parameters
Response:

No Content

Example

Sample Request:

curl https://api15.comm100.io/v4/ticketing/junks/0a5b1872-37c6-4599-92a6-ec00eb208450 \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \

Response:

 HTTP/1.1 204 No Content