Skip to main content

Sessions API

danger

The structures used in this API are NOT A GUARANTEE and will be removed no later than 31 January 2024.

Retrieve Session Messages

Retrieve a list of messages for a specific session.

Endpoint

GET 
https://api.cuedesk.com/v1/sessions/{sessionId}/messages?limit=20&offset=0
Content-Type: application/json

- Authorization: Bearer token
- {sessionId} (UUID): The UUID of the session.

- limit (integer, default: 20): The maximum number of messages to retrieve.
- offset (integer, default: 0): The starting index of the messages to retrieve.

Sample Response (With Text and Buttons)

{
"data": [
{
"uuid": "e8dbf48f-dc8a-4a2c-8f93-72a9dcf5aeed",
"from": "27721233221",
"to": "1234121241124",
"status": "inbound",
"messageType": "text",
"content": {
"text": "hello"
},
"error": null,
"createdAt": "2023-01-01T13:00:00Z",
"updatedAt": "2023-01-01T13:00:00Z"
},
{
"uuid": "4a6a26c5-5a3e-47f6-b3af-9834c2f1b0e9",
"from": "1234121241124",
"to": "27721233221",
"status": "read",
"messageType": "button",
"content": {
"header": {
"type": "text",
"value": "Welcome",
"filename": null
},
"body": "Hello there, we're here to help!",
"footer": "Please select an option",
"buttons": [
{
"id": "ePOo3AMi5BNnTTpCMioEQ",
"title": "Log a claim"
},
{
"id": "GExFo60h5e0Ta2hrP0A_X",
"title": "Manage my policy"
}
]
},
"error": null,
"createdAt": "2023-01-01T13:01:00Z",
"updatedAt": "2023-01-01T13:01:00Z"
},
{
"uuid": "ee01ccd2-49d4-4193-a4d5-44ee32a399b5",
"from": "27721233221",
"to": "1234121241124",
"status": "inbound",
"messageType": "reply",
"content": {
"id": "ePOo3AMi5BNnTTpCMioEQ",
"title": "Log a claim",
"description": null
},
"error": null,
"createdAt": "2023-01-01T13:02:00Z",
"updatedAt": "2023-01-01T13:02:00Z"
},
{
"uuid": "376eab88-6b11-4e09-9130-eb5f6b8e10ae",
"from": "1234121241124",
"to": "27721233221",
"status": "delivered",
"messageType": "text",
"content": {
"text": "Thank you for your response. An agent will be with you shortly."
},
"error": null,
"createdAt": "2023-01-01T13:03:00Z",
"updatedAt": "2023-01-01T13:03:00Z"
}
],
"total": 15
}

Sample Response (With Media)

{
"data": [
{
"uuid": "e8dbf48f-dc8a-4a2c-8f93-72a9dcf5aeed",
"from": "27721233221",
"to": "1234121241124",
"status": "inbound",
"messageType": "text",
"content": {
"text": "hello"
},
"error": null,
"createdAt": "2023-01-01T13:00:00Z",
"updatedAt": "2023-01-01T13:00:00Z"
},
{
"uuid": "f9a052c7-7a8f-4d71-b722-bd0a6ebf3db5",
"from": "1234121241124",
"to": "27721233221",
"status": "read",
"messageType": "video",
"content": {
"url": "https://media.cuedesk.com/...",
"caption": "sample video caption"
},
"error": null,
"createdAt": "2023-01-01T13:02:00Z",
"updatedAt": "2023-01-01T13:02:00Z"
},
{
"uuid": "376eab88-6b11-4e09-9130-eb5f6b8e10ae",
"from": "1234121241124",
"to": "27721233221",
"status": "delivered",
"messageType": "image",
"content": {
"url": "https://media.cuedesk.com/...",
"caption": "sample image caption"
},
"error": null,
"createdAt": "2023-01-01T13:03:00Z",
"updatedAt": "2023-01-01T13:03:00Z"
}
],
"total": 10
}

Sample Response (With Option List and User Reply)


{
"data": [
{
"uuid": "376eab88-6b11-4e09-9130-eb5f6b8e10ae",
"from": "1234121241124",
"to": "27721233221",
"status": "inbound",
"messageType": "text",
"content": {
"text":"Hello"
},
"error": null,
"createdAt": "2023-01-01T13:01:00Z",
"updatedAt": "2023-01-01T13:01:00Z"
},
{
"uuid": "f9a052c7-7a8f-4d71-b722-bd0a6ebf3db5",
"from": "1234121241124",
"to": "27721233221",
"status": "read",
"messageType": "list",
"content": {
"header": {
"type": "text",
"value": "Incident Report",
"filename": null
},
"body": "We notice that an emergency signal was triggered by your vehicle. Please can you select the most appropriate option:",
"footer": "MPL",
"sections": [
{
"title": "List Header :)",
"items": [
{
"id": "4sQk7stqygWyMjhvCYn19",
"title": "Pothole",
"description": "I have driven over a speedbump"
},
{
"id": "5JpI769pdnWuzTCIPnI3_",
"title": "Speedbump",
"description": "I have driven over a speedbump"
},
{
"id": "rOtGnAa-9pR-sN5mRu0b5",
"title": "Harsh Breaking",
"description": "I had to brake harshly"
},
{
"id": "PrstdvYLnwBGCsSHsk1hV",
"title": "Curb Impact",
"description": "I have hit a curb"
},
{
"id": "XMtIezL8Dbr9FNNxhQtYV",
"title": "Not Sure",
"description": "I am unsure what triggered the emergency signal"
}
]
}
]
},
"error": null,
"createdAt": "2023-01-01T13:02:00Z",
"updatedAt": "2023-01-01T13:02:00Z"
},
{
"uuid": "e8dbf48f-dc8a-4a2c-8f93-72a9dcf5aeed",
"from": "27721233221",
"to": "1234121241124",
"status": "inbound",
"messageType": "reply",
"content": {
"id": "rOtGnAa-9pR-sN5mRu0b5",
"title": "Harsh Breaking",
"description": "I had to brake harshly"
},
"error": null,
"createdAt": "2023-01-01T13:03:00Z",
"updatedAt": "2023-01-01T13:03:00Z"
},
{
"uuid": "376eab88-6b11-4e09-9130-eb5f6b8e10ae",
"from": "1234121241124",
"to": "27721233221",
"status": "read",
"messageType": "text",
"content": {
"text":"Thank you for your response. An agent will be with you shortly."
},
"error": null,
"createdAt": "2023-01-01T13:04:00Z",
"updatedAt": "2023-01-01T13:04:00Z"
}
],
"total": 12
}

Response Parameters

AttributeTypeDescription
uuidUUIDThe unique identifier of the message.
fromstringThe sender of the message.
tostringThe recipient of the message.
statusstringThe status of the message (e.g., "inbound | read | delivered | sent").
messageTypestringThe type of the message (e.g., "text | button | image").
contentobjectThe raw content of the message.
errorstringAny error associated with the message.
createdAtstringThe timestamp when the message was created.
updatedAtstringThe timestamp when the message was last updated.
totalintegerThe total number of messages available.

Error Response:

{
"type": "string",
"title": "error title",
"status": 500,
"instance": "/v1/sessions/{sessionId}/messages"
}
AttributeTypeDescription
typestringThe type of the error response.
titlestringThe title or description of the error.
statusintegerThe HTTP status code of the error response.
instancestringThe instance or URL that caused the error.
danger

The structures used in this API are NOT A GUARANTEE and will be removed no later than 31 January 2024.