Get Attachment
This request retrieves an attachment object with its contents.
Starting from version 8.4, the attachments endpoing is available for administrators only.
Users can retrieve attachments from endpoints that specify the container object.
See the Change Log of version 8u4 for more information.
Resource
GET /attachments/<OID>
Where <OID> is the object ID of the attachment.
Parameters
Name | Type | Description |
---|---|---|
|
Return the thumbnail of this attachment. See Get Thumbnail for more information. |
Payload
None
Response
The Attachment field contentsB64String
contains the data in Base64 econding.
Context
Authorization |
Admin |
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
GET https://xelion.nl/api/v1/master/phonelines/4124562
{ "object": { "voicemailDeliveryMessage": { "originalLocation": "xcc_audio6345091001260490816.wav", "mimeType": "audio/wav", "size": 0, "commonName": "xcc_audio6345091001260490816.wav", "oid": "1856742", "objectType": "Attachment" }, "permissions": "ReadWriteRemove", "commonName": "testline1234", "oid": "1856704", "objectType": "XCCPhoneLine" }, "links": [ { "rel": "self", "href": "https:xelion.nl/api/v1/master/phonelines/1856704", "method": "GET" } ] }
The voicemailDeliveryMessage member is returned without the actual binary contents.
This can be received with the following request.
GET https://xelion.nl/api/v1/master/attachments/11235813
{
"object": {
"originalLocation": "xcc_audio6345091001260490816.wav",
"mimeType": "audio/wav",
"contentsB64String": "/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAQABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD2fVdUmtLmCxsLZLrUrlHkiillMUYjQqHd3CsQAXQABWJLjjG5lNK1Sa7ubixv7ZLXUrZEkliilMsZjcsEdHKqSCUcEFVIKHjG1mNV0ua7uYL6wuUtdStkeOKWWIyxmNypdHQMpIJRCCGUgoOcblY0rS5rS5uL6/uUutSuUSOWWKIxRiNCxREQsxABdySWYkuecbVUA//Z",
"hasThumbnail": false,
"size": 0,
"commonName": "xcc_audio6345091001260490816.wav",
"oid": "1856742",
"objectType": "Attachment"
}
}