Get Chat Attachment


This request returns the attachment of an chat message.

Resource

GET /chats/<OID>/messages/<OID>/attachment

Where the first <OID> is the chat session object ID and the second <OID> is the object ID of the xcc user chat object.

Parameters

Name Type Description

response_type

[json|stream]

if stream is specified then the attachments contents are streamed to the client.

only_thumbnail

boolean

retrieve the thumbnail of this attachment. See Get Thumbnail for more information.

Payload

None

Response

The Attachment field contentsB64String contains the attachment’s data in Base64 econding.

Context

Authorization

User

Errors

HTTP code Xelion code Description

500

11000

If the attachment exceeds the maximum size or another server error occurred. See error message for more information.

Example

Request
GET https://xelion.nl/api/v1/master/chats/2313230/messages/587987561/attachment
Response
{
    "object": {
        "originalLocation": "file.txt",
        "mimeType": "text/plain",
        "contentsB64String": "SSBhbSBkb29tZWQgdG8gcmVtZW1iZXIgYSBib3kgd2l0aCBhIHdyZWNrZWQgdm9pY2XigJRub3QgYmVjYXVzZSBvZiBoaXMgdm9pY2UsIG9yIGJlY2F1c2UgaGUgd2FzIHRoZSBzbWFsbGVzdCBwZXJzb24gSSBldmVyIGtuZXcsIG9yIGV2ZW4gYmVjYXVzZSBoZSB3YXMgdGhlIGluc3RydW1lbnQgb2YgbXkgbW90aGVyJ3MgZGVhdGgsIGJ1dCBiZWNhdXNlIGhlIGlzIHRoZSByZWFzb24gSSBiZWxpZXZlIGluIEdvZC4=",
        "hasThumbnail": false,
        "size": 236,
        "commonName": "file.txt",
        "oid": "2313747",
        "objectType": "Attachment"
    }
}