Ticket
  • 31 Aug 2022
  • 13 Minutes to read
  • Dark
    Light

Ticket

  • Dark
    Light

Article summary

Ticket

Ticket JSON Format

Ticket is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idintAuto Increment Id of the ticket
subjectstringSubject of the ticket.
originalConversationIdstringConversion Id in original channel.
assigneeIdguidId of agent or chatbot that the ticket is assigned to.
departmentAssigneeIdguidId of department that the ticket is assigned to.
channelIdstringId of the channel of the first message of the ticket.
channelAccountIdguidId of the channel account of the first message of the ticket.
lastMessageIdguidId of the last message of the ticket.
lastMessageChannelIdstringId of the channel of the last message of the ticket.
lastMessageChannelAccountIdguidId of the channel account of the last message of the ticket.
contactOrVisitorIdguidId of the contact or visitor that the ticket related to.
createdByIdguidId of role(contact, visitor, chatbot, channelAccount, system, agent) who created the ticket.
lastRepliedByIdguidId of role who last replied the ticket.
resolvedByIdguidId of role resolved the ticket.
assigneeTypestringType of the ticket assignee. Allowed values are "agent", "chatbot".
contactOrVisitorTypestringType of the ticket contact. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
statusstringStatus of the ticket. Allowed values are "new", "pendingInternal", "pendingExternal", "onHold", "resolved".
prioritystringPriority of the ticket. Allowed values are "urgent", "high", "normal", "low".
createdByTypestringWho created the ticket. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
lastRepliedByTypestringWho replied the ticket recently. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
resolvedByTypestringWho the ticket is resolved by. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
isReadByAgentboolWhether the ticket is read by any agent or not.
isReadByContactboolWhether the ticket is read by the contact or not.
ifHasDraftboolWhether the ticket has draft or not.
mergedToTargetIdintegerId of the ticket that it was merged to.
totalRepliesintegerTotal number of messages, replied by agents, contacts or visitor.
createdTimedatetimeTime when the ticket is created.
lastUpdatedTimetimestampLast updated time of the ticket.
lastRepliedTimedatetimeLast replied time of the ticket.
lastStatusChangedTimedatetimeLast status changed time of the ticket.
resolvedTimedatetimeResloved time of the ticket.
isInRecycleBinboolWhether the ticket is in recyle bin or not.
reopenedTimedatetimeTime when the resolved ticket was reopened.
responseTimeSpanlongTotal amount of time the status of the ticket was pending internal.
replyingAgentstringAllowed values are "noReply", "agentOnly", "botOnly", "agentAndBot".
responseCountlongNumber of replies.
resolvedTimeSpanlongTotal time it took to resolve the ticket.
firstResponseTimeSpanlongTime it took for the agent to send the first response after a ticket is created.
tagstags[]Reference to Tag.
draftdraftReference to Draft.
noteMentionsnoteMentions[]Reference to NoteMention.
tagIdsarrayThe list of tag which belongs to the ticket.

NoteMention JSON Format:

NameTypeDescription
isReadByAgentboolWhether the mention has been read by agent or not.
noteIdguidId of the note which the mention belongs to.
idguidId of the mention.
agentIdguidId of the mentioned agent.
ticketIdselfIncrementIdId of the ticket which the note belongs to.

Get the list of Ticket

GET ticketing/tickets

  • Parameters:

NameTypeinRequiredDescription
tagidguidquerynoFilter by tag id.
timedatetimequerynoFilter by last updated time.
lastRepliedTimedatetimequerynoFilter by last replied time.
keywordsstringquerynoKeyword for searching
viewIdguidquerynoId of view
contactOrVisitorguidquerynoId of contact or visitor
contactOrVisitorTypestringquerynoContact or Visitor
includestringquerynoAllowed values are "ticketingTag", "ticketingEventLog", "ticketingDraft", "ticketingMessage", "lastMessage", "assignee", "departmentAssignee", "createdBy", "lastRepliedBy", "contactOrVisitor".
  • Response:

An array of Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "tickets": [
      {
          "id": 11,
          "subject": "Chat Transcript with Michael",
          "originalConversationId": "110778970771178_202317311617343",
          "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
          "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
          "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
          "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
          "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
          "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
          "assigneeType": "agent",
          "contactOrVisitorType": "contact",
          "status": "new",
          "priority": "normal",
          "createdByType": "contact",
          "lastRepliedByType": "agent",
          "resolvedByType": "agent",
          "isReadByAgent": false,
          "isReadByContact": false,
          "ifHasDraft": false,
          "mergedToTargetId": 89,
          "totalReplies": 4,
          "createdTime": "2021-05-12T08:10:53.48Z",
          "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
          "lastRepliedTime": "2021-05-12T08:10:53.486Z",
          "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
          "resolvedTime": "2021-05-12T08:10:53.486Z",
          "isInRecycleBin": false,
          "reopenedTime": "2021-04-07T05:59:17.887Z",
          "responseTimeSpan": 50,
          "replyingAgent": "",
          "responseCount": 3,
          "resolvedTimeSpan": 2517872,
          "firstResponseTimeSpan": 127,
          "tags": [
              {
                  "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
                  "name": "my tag"
              }
          ],
          "draft": {
              "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"
                  }
              ]
          },
          "noteMentions": [
              {
                  "isReadByAgent": false,
                  "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
                  "id": "277ed089-94de-4751-926e-bcae2fde95d4",
                  "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
                  "ticketId": "11"
              }
          ],
          "tagIds": [
              "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
          ]
      }
  ],
  "nextPage": null,
  "previousPage": null,
  "total": 1
} 

Get a single Ticket

GET ticketing/tickets/{id}

  • Parameters:

NameTypeinRequiredDescription
includestringquerynoAllowed values are "ticketingTag", "ticketingEventLog", "ticketingDraft", "ticketingMessage", "lastMessage", "assignee", "departmentAssignee", "createdBy", "lastRepliedBy", "contactOrVisitor".
  • Response:

Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11 \ 
    -X 'GET' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": 11,
  "subject": "Chat Transcript with Michael",
  "originalConversationId": "110778970771178_202317311617343",
  "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
  "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
  "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
  "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
  "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
  "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "assigneeType": "agent",
  "contactOrVisitorType": "contact",
  "status": "new",
  "priority": "normal",
  "createdByType": "contact",
  "lastRepliedByType": "agent",
  "resolvedByType": "agent",
  "isReadByAgent": false,
  "isReadByContact": false,
  "ifHasDraft": false,
  "mergedToTargetId": 89,
  "totalReplies": 4,
  "createdTime": "2021-05-12T08:10:53.48Z",
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "lastRepliedTime": "2021-05-12T08:10:53.486Z",
  "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
  "resolvedTime": "2021-05-12T08:10:53.486Z",
  "isInRecycleBin": false,
  "reopenedTime": "2021-04-07T05:59:17.887Z",
  "responseTimeSpan": 50,
  "replyingAgent": "",
  "responseCount": 3,
  "resolvedTimeSpan": 2517872,
  "firstResponseTimeSpan": 127,
  "tags": [
      {
          "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "name": "my tag"
      }
  ],
  "draft": {
      "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"
          }
      ]
  },
  "noteMentions": [
      {
          "isReadByAgent": false,
          "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
          "id": "277ed089-94de-4751-926e-bcae2fde95d4",
          "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "ticketId": "11"
      }
  ],
  "tagIds": [
      "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
  ]
} 

Create a new Ticket

POST ticketing/tickets

  • Parameters:

NameTypeinRequiredDescription
subjectstringbodyyesSubject of the ticket.
originalConversationIdstringbodynoConversion Id in original channel.
assigneeIdguidbodynoId of agent or chatbot that the ticket is assigned to.
departmentAssigneeIdguidbodynoId of department that the ticket is assigned to.
channelIdstringbodyyesId of the channel of the first message of the ticket.
channelAccountIdguidbodynoId of the channel account of the first message of the ticket.
contactOrVisitorIdguidbodyyesId of the contact or visitor that the ticket related to.
createdByIdguidbodynoId of role(contact, visitor, chatbot, channelAccount, system, agent) who created the ticket.
assigneeTypestringbodynoType of the ticket assignee. Allowed values are "agent", "chatbot".
contactOrVisitorTypestringbodynoType of the ticket contact. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
statusstringbodynoStatus of the ticket. Allowed values are "new", "pendingInternal", "pendingExternal", "onHold", "resolved".
prioritystringbodynoPriority of the ticket. Allowed values are "urgent", "high", "normal", "low".
createdByTypestringbodynoWho created the ticket. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
messagesmessages[]bodynoThe list of ticket messages.
tagIdsarraybodynoThe list of tag which belongs to the ticket.
  • Response:

Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"subject":"Chat Transcript with Michael","originalConversationId":"110778970771178_202317311617343","assigneeId":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","departmentAssigneeId":"91B032D9-0D07-4798-95F7-7EA482BC592C","channelId":"F9B07E54-0D35-4F53-BA63-1194E4297291","channelAccountId":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","contactOrVisitorId":"E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4","createdById":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","assigneeType":"agent","contactOrVisitorType":"contact","status":"new","priority":"normal","createdByType":"contact","lastMessage":{"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"}]},"messages":[{"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": 11,
  "subject": "Chat Transcript with Michael",
  "originalConversationId": "110778970771178_202317311617343",
  "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
  "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
  "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
  "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
  "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
  "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "assigneeType": "agent",
  "contactOrVisitorType": "contact",
  "status": "new",
  "priority": "normal",
  "createdByType": "contact",
  "lastRepliedByType": "agent",
  "resolvedByType": "agent",
  "isReadByAgent": false,
  "isReadByContact": false,
  "ifHasDraft": false,
  "mergedToTargetId": 89,
  "totalReplies": 4,
  "createdTime": "2021-05-12T08:10:53.48Z",
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "lastRepliedTime": "2021-05-12T08:10:53.486Z",
  "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
  "resolvedTime": "2021-05-12T08:10:53.486Z",
  "isInRecycleBin": false,
  "reopenedTime": "2021-04-07T05:59:17.887Z",
  "responseTimeSpan": 50,
  "replyingAgent": "",
  "responseCount": 3,
  "resolvedTimeSpan": 2517872,
  "firstResponseTimeSpan": 127,
  "tags": [
      {
          "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "name": "my tag"
      }
  ],
  "draft": {
      "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"
          }
      ]
  },
  "noteMentions": [
      {
          "isReadByAgent": false,
          "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
          "id": "277ed089-94de-4751-926e-bcae2fde95d4",
          "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "ticketId": "11"
      }
  ],
  "tagIds": [
      "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
  ]
} 

Merge ticket

POST ticketing/tickets/{id}:merge

  • Parameters:

NameTypeinRequiredDescription
sourceIdintegerbodyyesId of the ticket that will be merged.
  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets{1732}:merge \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"sourceId": "9527"}' 

Response:

HTTP/1.1 200 OK
### Read the Ticket
POST ticketing/tickets/{id}:read

  • Parameters:

No Parameters

  • Response:

Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11:read \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": 11,
  "subject": "Chat Transcript with Michael",
  "originalConversationId": "110778970771178_202317311617343",
  "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
  "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
  "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
  "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
  "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
  "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "assigneeType": "agent",
  "contactOrVisitorType": "contact",
  "status": "new",
  "priority": "normal",
  "createdByType": "contact",
  "lastRepliedByType": "agent",
  "resolvedByType": "agent",
  "isReadByAgent": true,
  "isReadByContact": false,
  "ifHasDraft": false,
  "mergedToTargetId": 89,
  "totalReplies": 4,
  "createdTime": "2021-05-12T08:10:53.48Z",
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "lastRepliedTime": "2021-05-12T08:10:53.486Z",
  "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
  "resolvedTime": "2021-05-12T08:10:53.486Z",
  "isInRecycleBin": false,
  "reopenedTime": "2021-04-07T05:59:17.887Z",
  "responseTimeSpan": 50,
  "replyingAgent": "",
  "responseCount": 3,
  "resolvedTimeSpan": 2517872,
  "firstResponseTimeSpan": 127,
  "tags": [
      {
          "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "name": "my tag"
      }
  ],
  "draft": {
      "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"
          }
      ]
  },
  "noteMentions": [
      {
          "isReadByAgent": false,
          "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
          "id": "277ed089-94de-4751-926e-bcae2fde95d4",
          "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "ticketId": "11"
      }
  ],
  "tagIds": [
      "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
  ]
} 

Recycle the ticket.

POST ticketing/tickets/{id}:recycle

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11:recycle \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 

Response:

HTTP/1.1 200 OK
### Unread the Ticket
POST ticketing/tickets/{id}:unread

  • Parameters:

No Parameters

  • Response:

Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11:unread \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 200 OK

{
  "id": 11,
  "subject": "Chat Transcript with Michael",
  "originalConversationId": "110778970771178_202317311617343",
  "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
  "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
  "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
  "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
  "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
  "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "assigneeType": "agent",
  "contactOrVisitorType": "contact",
  "status": "new",
  "priority": "normal",
  "createdByType": "contact",
  "lastRepliedByType": "agent",
  "resolvedByType": "agent",
  "isReadByAgent": false,
  "isReadByContact": false,
  "ifHasDraft": false,
  "mergedToTargetId": 89,
  "totalReplies": 4,
  "createdTime": "2021-05-12T08:10:53.48Z",
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "lastRepliedTime": "2021-05-12T08:10:53.486Z",
  "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
  "resolvedTime": "2021-05-12T08:10:53.486Z",
  "isInRecycleBin": false,
  "reopenedTime": "2021-04-07T05:59:17.887Z",
  "responseTimeSpan": 50,
  "replyingAgent": "",
  "responseCount": 3,
  "resolvedTimeSpan": 2517872,
  "firstResponseTimeSpan": 127,
  "tags": [
      {
          "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "name": "my tag"
      }
  ],
  "draft": {
      "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"
          }
      ]
  },
  "noteMentions": [
      {
          "isReadByAgent": false,
          "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
          "id": "277ed089-94de-4751-926e-bcae2fde95d4",
          "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "ticketId": "11"
      }
  ],
  "tagIds": [
      "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
  ]
} 

Get unread count of the ticket.

POST ticketing/tickets:unreadCount

  • Parameters:

NameTypeinRequiredDescription
viewIdsguid[]bodynoThe list of view id.
  • Response:

NameTypeDescription
allCountintegerAll unread count.
unreadCountsarrayThe list of unread count info for each view.
unreadCounts[].mentionedUnReadCountintegerUnread count for mentioned ticket.
unreadCounts[].mentionedUnReadTicketIdsselfIncrementId[]The list of id of the mentioned ticket which is unread.
unreadCounts[].unreadCountintegerUnread count for the view.
unreadCounts[].unreadTicketIdsselfIncrementId[]The list of id of the ticket which is unread.
unreadCounts[].viewIdguidId of the view.
  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets:unreadCount \ 
    -X 'POST' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"viewIds": ["f1ab6333-4260-eb11-aacf-06c7a219a2ac"]}' 

Response:

HTTP/1.1 200 OK

{
  "allCount": 145,
  "unreadCounts": [
      {
          "viewId": "f1ab6333-4260-eb11-aacf-06c7a219a2ac",
          "unreadTicketIds": [
              1994,
              1875
          ],
          "unreadCount": 145,
          "mentionedUnReadTicketIds": [],
          "mentionedUnReadCount": 0
      }
  ]
} 

Update the Ticket

PUT ticketing/tickets/{id}

  • Parameters:

NameTypeinRequiredDescription
subjectstringbodyyesSubject of the ticket.
originalConversationIdstringbodynoConversion Id in original channel.
assigneeIdguidbodynoId of agent or chatbot that the ticket is assigned to.
departmentAssigneeIdguidbodynoId of department that the ticket is assigned to.
channelIdstringbodyyesId of the channel of the first message of the ticket.
channelAccountIdguidbodynoId of the channel account of the first message of the ticket.
contactOrVisitorIdguidbodyyesId of the contact or visitor that the ticket related to.
createdByIdguidbodynoId of role(contact, visitor, chatbot, channelAccount, system, agent) who created the ticket.
assigneeTypestringbodynoType of the ticket assignee. Allowed values are "agent", "chatbot".
contactOrVisitorTypestringbodynoType of the ticket contact. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
statusstringbodynoStatus of the ticket. Allowed values are "new", "pendingInternal", "pendingExternal", "onHold", "resolved".
prioritystringbodynoPriority of the ticket. Allowed values are "urgent", "high", "normal", "low".
createdByTypestringbodynoWho created the ticket. Allowed values are "contact", "visitor", "chatbot", "channelAccount", "system", "agent".
isReadByAgentboolbodynoWhether the ticket is read by any agent or not.
isInRecycleBinboolbodynoWhether the ticket is in recyle bin or not.
messagesmessages[]bodynoThe list of ticket messages.
tagIdsarraybodynoThe list of tag which belongs to the ticket.
  • Response:

Ticket

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11 \ 
    -X 'PUT' \ 
    -H 'Authorization: Bearer {access_token}' \ 
    -H 'Content-Type: application/json' \ 
    -D '{"subject":"Chat Transcript with Michael","originalConversationId":"110778970771178_202317311617343","assigneeId":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","departmentAssigneeId":"91B032D9-0D07-4798-95F7-7EA482BC592C","channelId":"F9B07E54-0D35-4F53-BA63-1194E4297291","channelAccountId":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","contactOrVisitorId":"E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4","createdById":"1487fc9d-92e6-4487-a2e8-92e68d6892e6","assigneeType":"agent","contactOrVisitorType":"contact","status":"new","priority":"normal","createdByType":"contact","lastMessage":{"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"}]},"messages":[{"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 200 OK

{
  "id": 11,
  "subject": "Chat Transcript with Michael",
  "originalConversationId": "110778970771178_202317311617343",
  "assigneeId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "departmentAssigneeId": "91B032D9-0D07-4798-95F7-7EA482BC592C",
  "channelId": "F9B07E54-0D35-4F53-BA63-1194E4297291",
  "channelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastMessageChannelId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE3",
  "lastMessageChannelAccountId": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "contactOrVisitorId": "E23B5D3C-4E7E-4131-9B3A-52B061BA7DE4",
  "createdById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "lastRepliedById": "93AD44C8-CB30-40E1-8941-B693BAE74455",
  "resolvedById": "1487fc9d-92e6-4487-a2e8-92e68d6892e6",
  "assigneeType": "agent",
  "contactOrVisitorType": "contact",
  "status": "new",
  "priority": "normal",
  "createdByType": "contact",
  "lastRepliedByType": "agent",
  "resolvedByType": "agent",
  "isReadByAgent": false,
  "isReadByContact": false,
  "ifHasDraft": false,
  "mergedToTargetId": 89,
  "totalReplies": 4,
  "createdTime": "2021-05-12T08:10:53.48Z",
  "lastUpdatedTime": "2021-04-07T05:59:17.887Z",
  "lastRepliedTime": "2021-05-12T08:10:53.486Z",
  "lastStatusChangedTime": "2021-05-12T08:10:53.486Z",
  "resolvedTime": "2021-05-12T08:10:53.486Z",
  "isInRecycleBin": false,
  "reopenedTime": "2021-04-07T05:59:17.887Z",
  "responseTimeSpan": 50,
  "replyingAgent": "",
  "responseCount": 3,
  "resolvedTimeSpan": 2517872,
  "firstResponseTimeSpan": 127,
  "tags": [
      {
          "id": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "name": "my tag"
      }
  ],
  "draft": {
      "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"
          }
      ]
  },
  "noteMentions": [
      {
          "isReadByAgent": false,
          "noteId": "4d103607-f113-4884-8f7e-735f6fefdbf9",
          "id": "277ed089-94de-4751-926e-bcae2fde95d4",
          "agentId": "bdf96bad-890f-4af5-8f4e-42d2cc29e61b",
          "ticketId": "11"
      }
  ],
  "tagIds": [
      "1487fc9d-92e6-4487-a2e8-92e68d6892e6"
  ]
} 

Remove the Ticket

DELETE ticketing/tickets/{id}

  • Parameters:

No Parameters

  • Response:

No Content

  • Example

Sample Request:

curl https://api11.comm100.io/v4/ticketing/tickets/11 \ 
    -X 'DELETE' \ 
    -H 'Authorization: Bearer {access_token}' \ 

Response:

HTTP/1.1 204 No Content


Was this article helpful?

What's Next