Get Thumbnail
This request returns the thumbnail contents of an attachment object.
The attachment objects that are returned from the API can have thumbnails, the flag hasThumbnail is set to true.
To receive the contents of an thumbnail this API call is used.
A thumbnail is a jpeg image.
Thumbnail can also be loaded directly from the Communication API calls by setting the flag include=attachments,thumbnails.
Resource
GET /attachments/<OID>?only_thumbnail
Where <OID> is the object ID of the attachment.
Parameters
Name | Type | Description |
---|---|---|
|
Add this parameter to only load the thumbnail of this attachment. |
Payload
None
Response
The Attachment field thumbnailB64String
contains the thumbnail data in Base64 econding.
Context
Authorization |
User |
Errors
Example
GET https://xelion.nl/api/v1/master/communications/recent?include=attachments
{ "data": [ { "object": { "addressable": { "commonName": "Wesley", "oid": "1650975", "objectType": "Person" }, "lastCommunication": { "subject": "Coffee Moves.mp4", "date": "2020-05-19 12:45:49", "durationSec": 0, "incoming": true, "retrieved": false, "displayed": false, "flagged": false, "forwarded": false, "hasAttachment": true, "hasInlineAttachment": false, "contentSummary": "Coffee Moves.mp4", "contentSummaryIsComplete": true, "participants": [ { "commonName": "Wesley", "role": "rtFrom", "addressable": { "commonName": "Wesley", "oid": "1650975", "objectType": "Person" }, "addresseeLabel": "Wesley", "oid": "1899628", "objectType": "Addressee" }, { "commonName": "Arno", "role": "rtTo", "addressable": { "commonName": "Arno", "oid": "1650938", "objectType": "Person" }, "addresseeLabel": "Arno", "oid": "1899629", "objectType": "Addressee" } ], "attachments": [ { "originalLocation": "Coffee Moves.mp4", "mimeType": "video/mp4", "hasThumbnail": true, "size": 2197, "commonName": "Coffee Moves.mp4", "oid": "1899618", "objectType": "Attachment" } ], "voicemail": false, "chatSessionType": "user", "commonName": " Coffee Moves.mp4", "oid": "1899627", "objectType": "XCCUserChat" }, "notificationsCount": 36 }, "links": [ { "rel": "self", "href": "https://xelion.nl/api/v1/master/addressables/1650975", "method": "GET" } ] } ], "meta": { "links": [ { "rel": "refresh", "href": "https://xelion.nl/api/v1/master/communications/recent", "method": "GET" }, { "rel": "previous", "href": "https://xelion.nl/api/v1/master/communications/recent?before=2020-05-05+14%3A06%3A11", "method": "GET" } ], "paging": { "previousId": "2020-05-05 14:06:11" } } }
The attachmements collection has a member hasThumbnail that is set to true.
The thumbnail can be received with the following request.
GET https://xelion.nl/api/v1/master/attachments/1899618?only_thumbnail
{
"object": {
"originalLocation": "xcc_audio6345091001260490816.wav",
"mimeType": "audio/wav",
"hasThumbnail": true,
"thumbnailB64String": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAQABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD2fVdUmtLmCxsLZLrUr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