FileAttachList

Identifies a file and the action to perform against it.

Values

Name Type Description
action (optional)
  • NEW-ONLY (string)
  • UPDATE-ONLY (string)
  • NEW-UPDATE (string)
  • DELETE (string)

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)
  • ATTACHACCESS-DEFAULT (string)
  • ATTACHACCESS-RESTRICTED (string)
  • ATTACHACCESS-UNRESTRICTED (string)

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.

Usage

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:

Example

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

Comments

None.