Get Chat Session’s Messages


This request retrieve chat messages of a chat session. The messages are ordered by date in a descending order.

Resource

GET /chats/<OID>/messages

Where OID is the object ID of the chat session.

Parameters

Name Type Description

name

String

Select communication objects which name matches this string. The name is usually auto generated from the object fields, except email name which is equal to the message’s subject.

before

[id]

Paging: return results before the specified cursor ID.

after

[id]

Paging: return results after the specified cursor ID.

from

[Date]

Search for communications that happens from this date or later, result order doesn’t matter.

until

[Date]

Search for communications that happens until this date or earlier, result order doesn’t matter.

Payload

None

Response

Context

Authorization

User

Errors

Example

Request
GET https://xelion.nl/api/v1/master/chats/1588675/messages
Response
{
    "data": [
        {
            "object": {
                "subject": "hello there",
                "date": "2024-10-11 15:24:19",
                "durationSec": 0,
                "incoming": false,
                "retrieved": true,
                "displayed": true,
                "displayedUser": "",
                "flagged": false,
                "forwarded": false,
                "processed": false,
                "recordingStatus": "unknown",
                "hasAttachment": false,
                "hasInlineAttachment": false,
                "hasMessageReference": false,
                "contentSummary": "hello there",
                "contentSummaryIsComplete": true,
                "participants": [],
                "voicemail": false,
                "voicemailIsHeard": false,
                "callId": "",
                "id": "ce446930aee57b45",
                "callFlowId": "",
                "chatSessionType": "user",
                "whatsAppTemplateCategory": "",
                "original": {
                    "contentSummary": "we need a bigger boat",
                    "contentSummaryIsComplete": false,
                    "participants": [],
                    "commonName": "Arno -> Haas, 2024-10-11",
                    "oid": "4647666",
                    "objectType": "XCCUserChat"
                },
                "originalFromName": "Arno",
                "originalFromAddressable": {
                    "commonName": "Arno",
                    "oid": "1389401",
                    "objectType": "Person"
                },
                "transferredFromName": "",
                "transferredToName": "",
                "chatSession": {
                    "oid": "1935036",
                    "objectType": "XCCChatSession"
                },
                "afterCallType": "",
                "commonName": "Arno -> haas, 2024-10-11",
                "oid": "4647700",
                "objectType": "XCCUserChat"
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://developer.xelion.nl/api/v1/master/communications/4647700",
                    "method": "GET"
                }
            ]
        },
        {
            "object": {
                "subject": "we need a bigger boat",
                "date": "2024-10-11 15:20:42",
                "durationSec": 0,
                "incoming": false,
                "retrieved": true,
                "displayed": true,
                "displayedUser": "",
                "flagged": false,
                "forwarded": false,
                "processed": false,
                "recordingStatus": "unknown",
                "hasAttachment": false,
                "hasInlineAttachment": false,
                "hasMessageReference": false,
                "contentSummary": "we need a bigger boat",
                "contentSummaryIsComplete": true,
                "participants": [],
                "voicemail": false,
                "voicemailIsHeard": false,
                "callId": "",
                "id": "d9c2cbbde7cdd747",
                "callFlowId": "",
                "chatSessionType": "user",
                "whatsAppTemplateCategory": "",
                "transferredFromName": "",
                "transferredToName": "",
                "chatSession": {
                    "oid": "1935036",
                    "objectType": "XCCChatSession"
                },
                "afterCallType": "",
                "commonName": "Arno -> haas, 2024-10-11",
                "oid": "4647666",
                "objectType": "XCCUserChat"
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://developer.xelion.nl/api/v1/master/communications/4647666",
                    "method": "GET"
                }
            ]
        },
        {
            "object": {
                "subject": "hello there",
                "date": "2024-10-11 15:14:27",
                "durationSec": 0,
                "incoming": false,
                "retrieved": true,
                "displayed": true,
                "displayedUser": "",
                "flagged": false,
                "forwarded": false,
                "processed": false,
                "recordingStatus": "unknown",
                "hasAttachment": true,
                "hasInlineAttachment": false,
                "hasMessageReference": false,
                "contentSummary": "hello there",
                "contentSummaryIsComplete": true,
                "participants": [],
                "voicemail": false,
                "voicemailIsHeard": false,
                "callId": "",
                "id": "73830f926be8ed81",
                "callFlowId": "",
                "chatSessionType": "user",
                "whatsAppTemplateCategory": "",
                "transferredFromName": "",
                "transferredToName": "",
                "chatSession": {
                    "oid": "1935036",
                    "objectType": "XCCChatSession"
                },
                "afterCallType": "",
                "commonName": "Arno -> haas, 2024-10-11",
                "oid": "4647577",
                "objectType": "XCCUserChat"
            },
            "links": [
                {
                    "rel": "self",
                    "href": "https://developer.xelion.nl/api/v1/master/communications/4647577",
                    "method": "GET"
                }
            ]
        }
    ],
    "meta": {
        "links": [
            {
                "rel": "refresh",
                "href": "https://developer.xelion.nl/api/v1/master/chats/1935036/messages",
                "method": "GET"
            },
            {
                "rel": "next",
                "href": "https://developer.xelion.nl/api/v1/master/chats/1935036/messages?after=4647700",
                "method": "GET"
            },
            {
                "rel": "previous",
                "href": "https://developer.xelion.nl/api/v1/master/chats/1935036/messages?before=4647577",
                "method": "GET"
            }
        ],
        "paging": {
            "previousId": "4647577",
            "nextId": "4647700"
        }
    }
}