FileObjList

Identifies a file in a File field or a URL in a URL field 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 file or URL in the TS_FILEOBJS table. Only used for identification purposes on update or delete.

uuid (optional) UUID (string)

Used to identify a file or URL by UUID. Only used for identification purposes on update or delete.

name (optional) NAME (string)

Used to identify a file or URL by the user-provided name (e.g. "My Screenshot").

For File fields, if name is blank on update, the filename attribute is used.

For URL fields, if name is blank on update, the contents attribute is used.

filename (required for adding files; optional when updating or deleting) FILENAME (string)

Used to identify a file by the actual file name (e.g. myFile.txt). Used with the UpdateFileField call.

contentsbase64 (required for adding files; optional when updating or deleting) {data: ""}

The base64-encoded file. Used with the UpdateFileField call.

contents (required for adding URLs; optional when updating or deleting) CONTENTS (string)

The actual URL. Used with the UpdateURLField call.

Usage

The fileObjList is an array of files or URLs that you want to add, update, or delete in a POST.

The following actions are available:

Example

The following example shows fileObjList an UpdateFileField call that deletes a file and adds a new file.

{
 "deleteAll": false,
 "includeFile": false,
 "breakLock": true,
 "alwaysTrans": false,
 "fileObjFilter": ["Details"],
 "fileObjList": [{
  "action": "DELETE",
  "id": 0,
  "name": "Issue Details",
  "filename": "details.txt"
 },
 {
  "action": "NEW-ONLY",
  "id": 0,
  "name": "Details",
  "filename": "new_details.txt",
  "contentsbase64": {
   "data": "QUFBQUFB...MzMzMw=="
  }
 }
 ]
}

Response:

{
 "fieldFileObj": {
  "id": 189,
  "uuid": "c24c3001-a999-40fa-9dd8-42b0fc728ea5",
  "name": "FileField",
  "dbname": "FILEFIELD",
  "fldtype": 132,
  "fldtypelabel": "file",
  "fileObjList": [{
   "id": 26,
   "uuid": "8560f131-78fe-481d-8800-56d596195f82",
   "name": "Details",
   "filename": "new_details.txt",
   "filesize": 70,
   "fileurl": "http://AEserverName...FileObjectPage&FileObjId=26/new_details.txt"
  }],
   "fileObjCount": 1
  },
  "result": {
   "type": "OK",
   "msg": "The item was successfully transitioned.",
   "msgLoc": "The item 1000:140 was successfully transitioned."
 }
}

The following example shows fileObjList an UpdateURLField call that deletes a URL and adds a new URL.

{
  "deleteAll":false,
  "includeFile":false,
  "breakLock":true,
  "alwaysTrans":false,
  "fileObjFilter": [ "public site" ],
  "fileObjList": [ {
    "action":"DELETE",
    "id":0,
    "uuid":"",
    "name":"intranet site",
    "contents": "http://intranet.company.com/"
  },
  {
    "action":"NEW-UPDATE",
    "id":0,
    "uuid":"",
    "name":"public site",
    "contents": "http://company.com/"
  }                
 ]
}

Response:

{
 "fieldFileObj": {
  "id": 190,
  "uuid": "434e87ba-244c-4577-9fde-9d7d4233db4d",
  "name": "URLField",
  "dbname": "URLFIELD",
  "fldtype": 133,
  "fldtypelabel": "url",
  "fileObjList": [{
   "id": 31,
   "uuid": "e8687396-246c-43f1-92ac-f2f266719b98",
   "name": "public site",
   "contents": "http://company.com/"
  }],
  "fileObjCount": 1
 },
 "result": {
  "type": "OK",
  "msg": "The item was successfully transitioned.",
  "msgLoc": "The item 1000:137 was successfully transitioned."
 }
}

Comments

None.