UpdateURLField

Adds, updates, or deletes URLs in a URL field on an item.

A POST JSON body is required.

Parameters

Name Type Description
UpdateURLField Function

Adds, updates, or deletes URLs in a URL field.

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

The table identifier.

item
  • ID (integer)
  • UUID (string)

The item identifier.

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

The File field identifier.

transition (optional)
  • ID (integer)
  • UUID (string)
  • internal name (string)
  • name (string)

The transition identifier to use. If 0, a valid Update transition is used (if found).

Tip: Run GetItemTransitions first to determine the transition identifier that you will specify.

Not all transitions have an internal name. Those that do return the internal name as dbname in the GetItemTransitions response.

Post Data

Name Type Description
includeFile

(optional)

boolean

Use includeFile to return the base64-encoded contents of the file. Default is false.

deleteAll

(optional)

boolean

Deletes all files in the File field on the specified item. Default is false.

breakLock (optional) boolean

Allows the JSON API to steal the record lock from any user who might have one on this item, so that this call should not fail due to a user having the record locked. However, this causes any user who has a transition form open on this item to get an error when he or she tries to commit the transition. Default is true.

alwaysTrans (optional) boolean

If set to true, this runs the transition even if the File field was not changed. Default is false.

fileObjFilter

(optional)

Array of file identifiers
  • ID (integer or string)
  • UUID (string)
  • FILENAME (string)
  • NAME (string)

Include fileObjFilter to filter the files that are returned. Otherwise, all files 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 files.

fileObjList

(required)

FileObjList

Array of files that you want to add, update, or delete in a File field.

Example

URL:

http://AEserverName/jsonapi/UpdateURLField/1000/140/URLFIELD/0

Post data:

{
  "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.