JSON API Guide → Reference → GET Functions → GetFileAttachments
Gets file attachments on a primary or auxiliary item.
Name | Type | Description |
---|---|---|
GetFileAttachments | Function |
Returns file attachments from an item. |
table |
|
The primary or auxiliary table identifier. |
item |
|
The item identifier. |
You can optionally use the GetFileAttachments function in an HTTP POST and include one or more of the following objects:
Name | Type | Description |
---|---|---|
includeFile
(optional) |
boolean |
Use includeFile to return the base64-encoded contents of the file. Default is true. Note: If one or more files are included in the
response, the cumulative total of all files that are returned is limited to 50
MB in size. If the total size of the included files is greater than 50 MB in
size, you will only receive the meta data about the file attachments in the
response. To change the size limit for all files in the response, see solution
S142607.
|
fileAttachFilter
(optional) |
Array of identifiers
|
Include fileAttachFilter to filter the attachments that are returned. Otherwise, all file attachments are returned by default. Note that you can pass any type of identifier in the array, or a combination of them in order to return the desired attachments. |
URL:
http://AEserverName/jsonapi/GetFileAttachments/1000/141
Post data:
{"includeFile":true, "fileAttachFilter": [46, "another screenshot" ]}
Response:
{ "fileattachments": { "files": [{ "id": 46, "title": "screenshot of issue", "fileName": "screenshot.png", "fileSize": 14998, "showAsImage": false, "modificationDateTime": 1532020749, "accessType": "ATTACHACCESS-RESTRICTED", "url": "http://AEserverName...AttachmentPage&AttachmentID=46/screenshot.png", "contentsBase64": { "data": "iVBORw...Jggg==" } }, { "id": 47, "title": "another screenshot", "fileName": "screenshot2.png", "fileSize": 138157, "showAsImage": false, "modificationDateTime": 1532020874, "accessType": "ATTACHACCESS-RESTRICTED", "url": "http://AEserverName...AttachmentPage&AttachmentID=47/screenshot2.png", "contentsBase64": { "data": "iVBO...EQICI=" } }] }, "result": { "type": "OK", "msg": "" } }
Because the TS_ID is subject to change in a promotion context, you may need to update the table and item parameters with the TS_ID from the target environment after the promote is finished.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.