Skip to content

Get chat messages report

Getting all messages from a chat

Method get.chat_messages_report
Description Getting all messages from a chat
Who has access Partner, Customer

Parameters of a request

Title Type Required Valid value Description
access_token string yes Authentication session key
user_id number no Unique user ID of agent's customer who makes request
Is required for agent
To get a list of customer users, use the method "get.customer_users"
limit number no Returning entries count. Refer to "Paging"
offset number no Offset that defines from which number to return the entries "limit". Default value is "0". Refer to "Paging"
filter object no Refer to "Filters"
fields array no Refer to "Viewing returning data"
sort array no Refer to "Data sorting"
date_from iso8601 yes YYYY-MM-DD hh:mm:ss Sampling start date
date_till iso8601 yes YYYY-MM-DD hh:mm:ss Sampling end date

Parameters of a reply

Title Type Valid values Filtering Sorting Default reply Description
chat_id number yes yes Chat unique ID, refer to "get.chats_report"
date_time iso8601 YYYY-MM-DD hh:mm:ss yes yes Time and date when a message was sent
All messages must be in the order they are sent, i.e. sorted by field "date_time"
text string yes Message text
source enum Operator, Visitor, System yes Message source
Employee
employee_id number yes yes yes Employee unique ID
employee_full_name string yes Employee full name

JSON request structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"get.chat_messages_report",
  "params":{
    "access_token":"string",
    "chat_id":"number",
    "user_id":"number",
    "offset":"number",
    "limit":"number",
    "filter":{

    },
    "sort":[
      {
        "field":"string",
        "order":"string"
      }
    ],
    "fields":[
      "string"
    ]
  }
}

JSON reply structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "result":{
    "metadata":{

    },
    "data":[
      {
        "chat_id":"number",
        "date_time":"iso8601",
        "text":"string",
        "source":"enum",
        "employee_id":"number",
        "employee_full_name":"string"
      }
    ]
  }
}

List of returning errors

Refer to the section "List of errors for the methods with the verb get"