Get Chat Events
The messages, notes and line items on a chat, oldest first, paginated.
GETting the chat itself embeds the same events under _embedded.events, so a small chat usually needs one request rather than two. Use this endpoint when a chat is long enough to page through.
Request
GET /v2/chats/5a0da3c3-4882-3352-8db9-8fc47e14111f/events?pageSize=25&page=1 HTTP/1.1
Authorization: Bearer oauth_token
Path Parameters
/v2/chats/{chatId}/events
Query Parameters
| Name | Type | Description |
|---|---|---|
page |
Number |
The page to return. Defaults to 1. |
pageSize |
Number |
Events per page. Defaults to 25. |
Response
HTTP/1.1 200 OK
Content-Type: application/hal+json
{
"_embedded": {
"events": [
{
"id": "80af4089-7157-3df3-b4a0-3453ad6bb244",
"chatId": "5a0da3c3-4882-3352-8db9-8fc47e14111f",
"type": "message",
"action": "message-added",
"author": {
"id": 498746,
"type": "customer",
"first": "Vernon",
"last": "Bear",
"email": "bear@acme.com"
},
"createdAt": "2020-07-03T07:03:29.982028Z",
"body": "Whoa there!",
"_links": {
"author": {
"href": "..."
}
}
},
{
"id": "2427d95b-7a4e-3be4-b8a6-a6ce89b5a7e2",
"chatId": "5a0da3c3-4882-3352-8db9-8fc47e14111f",
"type": "line_item",
"action": "chat-accepted",
"author": {
"id": 4440,
"type": "user",
"first": "Jack",
"last": "Sprout",
"email": "jack.sprout@gmail.com"
},
"createdAt": "2020-07-03T07:03:59.982028Z",
"_links": {
"author": {
"href": "..."
}
}
}
]
},
"page": {
"size": 25,
"totalElements": 2,
"totalPages": 1,
"number": 1
},
"_links": {
"self": {
"href": "..."
},
"first": {
"href": "..."
},
"last": {
"href": "..."
},
"next": {
"href": "..."
}
}
}
Response fields
| Path | Type | Description |
|---|---|---|
_embedded.events |
Array |
Event values |
page |
Object |
Page information |
Event object
| Path | Type | Description |
|---|---|---|
id |
String |
Unique identifier. For a message or a note this is the id the caller chose when creating it. |
chatId |
String |
The chat the event belongs to |
type |
String |
message, note or line_item |
action |
String |
What happened, for example message-added, note-added, chat-accepted, chat-assigned, chat-ended |
author |
Object |
Who caused it — a user, a customer, or the system |
createdAt |
String |
The ISO8601 timestamp of when the event was created |
body |
String |
The event body. Absent on a line item. |
Page object
| Path | Type | Description |
|---|---|---|
size |
Number |
Events per page |
totalElements |
Number |
Events on the chat |
totalPages |
Number |
Pages available |
number |
Number |
The page returned |
Resource Links
| Relation | Description |
|---|---|
self |
This page of events |
first |
The first page |
last |
The last page |
next |
The next page, when there is one |