GetFileAttachments

Gets file attachments on a primary or auxiliary item.

Parameters

Name Type Description
GetFileAttachments Function

Returns file attachments from an item.

table
  • ID (integer)
  • UUID (string)
  • dbname (string)
  • name (string)

The primary or auxiliary table identifier.

item
  • ID (integer)
  • UUID (string)

The item identifier.

Post Data

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
  • ID (integer or string)
  • FILENAME (string)
  • TITLE (string)

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.

Example

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": ""
 }
}

Comments

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.