Draft
- 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Draft
- Updated on 16 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Draft
Draft of ticket.
Draft
- Draft ManageGET ticketing/tickets/{id}/draft
- Get a single DraftPUT ticketing/tickets/{id}/draft
- Update the DraftDELETE ticketing/tickets/{id}/draft
- Remove the Draft
Draft JSON Format
Draft is represented as simple flat JSON objects with the following keys:
Name | Type | Description |
---|---|---|
ticketId | selfIncrementId | Id of the ticket. |
body | string | Content of the draft. 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. |
metadata | object | Message metadata, Json format. |
lastUpdatedById | guid | Id of the agent who updates the draft recently. |
lastUpdatedTime | timestamp | Last time when the draft was updated. |
type | string | Type of draft. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView". |
attachments | attachments[] | Reference to DraftAttachment. |
DraftAttachment JSON Format:
Name | Type | Description |
---|---|---|
id | guid | Id of the attachment. |
fileKey | string | Unique key in file service. |
name | string | Name of the attachment. |
size | integer | Size of the attachment. |
ticketId | selfIncrementId | Id of the ticket which the draft belongs to. |
type | string | Type of the attachment. Allowed values are "video", "audio", "image", "file". |
url | string | Download URL of the attachment. |
Get a single Draft
GET ticketing/tickets/{id}/draft
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
include | string | query | no | Allowed value is "ticketingDraftAttachment". |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/tickets/11/draft \
-X 'GET' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 200 OK
{
"ticketId": "11",
"body": "data:text/plain;base64,PHA+MTExPC9wPg==",
"metadata": {
"channel": null,
"source": null,
"decoration": {
"files": null,
"location": null,
"buttons": null,
"quickReplies": null,
"email": {
"from": null,
"to": null,
"cc": "test@163.com;",
"bcc": null,
"subject": "111",
"quote": "",
"ifHasAttachmentNotReceived": false
}
},
"context": null
},
"lastUpdatedById": "bddb18ba-b3f7-4e1a-8636-f8467b6c13b7",
"lastUpdatedTime": "2021-04-29T01:22:48.992Z",
"type": "html",
"attachments": [
{
"id": "7cee5281-95b8-43cc-8c1e-f6424d69f002",
"fileKey": "isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7",
"name": "my file",
"size": 10,
"ticketId": "100",
"type": "file",
"url": "http://myfile/url"
}
]
}
Update the Draft
PUT ticketing/tickets/{id}/draft
Parameters:
Name | Type | in | Required | Description |
---|---|---|---|---|
body | string | body | no | Content of the draft. 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. |
metadata | object | body | yes | Message metadata, Json format. |
lastUpdatedById | guid | body | no | Id of the agent who updates the draft recently. |
lastUpdatedTime | timestamp | body | no | Last time when the draft was updated. |
type | string | body | yes | Type of draft. Allowed values are "text", "html", "video", "audio", "image", "file", "location", "quickReply", "webView". |
attachments | attachments[] | body | no | Attachment in draft message. |
Response:
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/tickets/11/draft \
-X 'PUT' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-D '{"body":"data:text/plain;base64,PHA+MTExPC9wPg==","metadata":{"channel":null,"source":null,"decoration":{"files":null,"location":null,"buttons":null,"quickReplies":null,"email":{"from":null,"to":null,"cc":"test@163.com;","bcc":null,"subject":"111","quote":"","ifHasAttachmentNotReceived":false}},"context":null},"lastUpdatedById":"bddb18ba-b3f7-4e1a-8636-f8467b6c13b7","lastUpdatedTime":"2021-04-29T01:22:48.992Z","type":"html","attachments":[{"fileKey":"isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7","name":"my file","size":10,"ticketId":"100","type":"file","url":"http://myfile/url"}]}'
Response:
HTTP/1.1 200 OK
{
"ticketId": "11",
"body": "data:text/plain;base64,PHA+MTExPC9wPg==",
"metadata": {
"channel": null,
"source": null,
"decoration": {
"files": null,
"location": null,
"buttons": null,
"quickReplies": null,
"email": {
"from": null,
"to": null,
"cc": "test@163.com;",
"bcc": null,
"subject": "111",
"quote": "",
"ifHasAttachmentNotReceived": false
}
},
"context": null
},
"lastUpdatedById": "bddb18ba-b3f7-4e1a-8636-f8467b6c13b7",
"lastUpdatedTime": "2021-04-29T01:22:48.992Z",
"type": "html",
"attachments": [
{
"id": "7cee5281-95b8-43cc-8c1e-f6424d69f002",
"fileKey": "isqo-ngLG1Vw7Uh0ieeIGXSjVoAX2DhmQKeWmi7",
"name": "my file",
"size": 10,
"ticketId": "100",
"type": "file",
"url": "http://myfile/url"
}
]
}
Remove the Draft
DELETE ticketing/tickets/{id}/draft
Parameters:
No Parameters
Response:
No Content
Example
Sample Request:
curl https://api11.comm100.io/v4/ticketing/tickets/11/draft \
-X 'DELETE' \
-H 'Authorization: Bearer {access_token}' \
Response:
HTTP/1.1 204 No Content
Was this article helpful?