JSON API Guide → Reference → POST Functions → UpdateFileAttachments
Adds, updates, or deletes file attachments on an item.
A POST JSON body is required.
Name | Type | Description |
---|---|---|
UpdateFileAttachments | Function |
Adds, updates, or deletes file attachments on an item. |
table |
|
The table identifier. |
item |
|
The item identifier. |
Name | Type | Description |
---|---|---|
includeFile
(optional) |
boolean |
Use includeFile to return the base64-encoded contents of the file. Default is false. 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.
|
deleteAll
(optional) |
boolean |
Deletes all file attachments on the specified item. Default is false. |
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. |
fileAttachList
(required) |
FileAttachList |
Array of file attachments that you want to add, update, or delete. |
URL:
http://AEserverName/jsonapi/UpdateFileAttachments/1000/140
Post data:
{ "deleteAll":false, "includeFile":false, "fileAttachFilter": [ "" ], "fileAttachList": [ { "action":"DELETE-FILE", "id":0, "title":"log file", "filename":"logfile.txt", "accessType":"", "showAsImage":"" }, { "action":"NEW-ONLY", "id":46, "title":"abc", "filename":"abc.txt", "contentsbase64": { "data":"QUFB...MzMzMw==" }, "accessType":"ATTACHACCESS-UNRESTRICTED", "showAsImage":"false" } ] }
Response:
{ "fileattachments": { "files": [{ "id": 58, "title": "abc", "fileName": "abc.txt", "fileSize": 70, "showAsImage": false, "modificationDateTime": 1532450986, "accessType": "ATTACHACCESS-UNRESTRICTED", "url": "http://AEserverName:80...AttachmentPage&AttachmentID=58/abc.txt" }], }, "result": { "type": "OK", "msg": "" } }
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.