JSON API Guide → JSON API Options → FileAttachList
Identifies a file and the action to perform against it.
| Name | Type | Description |
|---|---|---|
| action (optional) |
|
The action to perform. The default is NEW-UPDATE. |
| id (optional) | ID (integer) |
The TS_ID of the attachment in the TS_ATTACHMENTS table. Only used for update or delete. |
| title (optional) | TITLE (string) |
Used to identify a file by the user-provided name (e.g. "My Screenshot"). If blank, defaults to filename attribute. |
| filename (required for adding; optional for updating or deleting) | FILENAME (string) |
Used to identify a file by the actual file name (e.g. myFile.txt). |
| contentsbase64 (required for adding; optional for updating or deleting) | {data: ""} |
The base64-encoded file. |
| accessType (optional) |
|
Sets the attachment access level. The default is ATTACHACCESS-DEFAULT. |
| showAsImage (optional) | boolean |
Sets the flag to show the attachment as an image (if applicable) when viewing the item in the Web browser. Default is false. |
The fileAttachList is an array of files that you want to add, update, or delete in an UpdateFileAttachments POST.
The following actions are available:
The following attachment access-types are available:
The following example shows fileAttachList in an UpdateFileAttachments call that deletes an attachment and adds a new attachment.
"fileAttachList": [ {
"action":"DELETE",
"id":0,
"title":"log file",
"filename":"logfile.txt",
"accessType":"",
"showAsImage":""
},
{
"action":"NEW-ONLY",
"id":46,
"title":"abc",
"filename":"abc.txt",
"contentsbase64": {
"data":"QUFB...zMzMw=="
},
"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": ""
}
}
None.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.