This is an old revision of the document!
Home > Developer > Lookafter Storage System API > GetItemInfo
Script path: /storage/bin/api/get_item_info.cgi
Description: Returns information about an item (file or folder). Information you want to retrieve is specified using the fields parameter, which is a string consisting of comma separated field names.
INPUT (via GET or POST)
Mandatory parameters are: sid, path
Optional parameters are: fields, ofmt
Session id of the login user. [mandatory]
Path to a folder. [mandatory]
Please refer to How to specify a path.
Path must point to an existing folder. E.g.:
= name,date,dategmt,mtime,size,type,owner,company,lock,description,checksum,lock_owner,ucar
= name,date,size,type (this is default if no fields are provided)
The field names may be any order and the returned field values will follow that order. Separate the field names with commas but do not include any spaces. Fields obmitted will not be returned. Returned value for a field can be empty strings. If a field does not exist in the item's information record, an empty field is returned. WARNING: a misspelled field name will be quietly ignored, i.e. returned empty value!
Output format
= json means to return output in JSON format (with minimum or no redundant white spaces)
= jsonp means to return ouput in JSON format, pretty-printed for easy human readability.
otherwise (default, or not specified), means the legacy “flat” formatting output is assumed.
In the legacy “flat” output format, the returned value for ucar is in a “flat” not pretty-printed JSON object string. It cannot be pretty-printed because it will break the flat format. In a JSON output formt, the returned value for ucar is also a JSON object nested in overall JSON object, and can be pretty-printed as requested.
Successful return:
true <newline> <tab separated field values for the item> <newline>
e.g.
true newfolder <TAB> 20010206180115 <TAB> 0 <TAB> folder
Unsuccessful return:
false <tab> <error message> <newline>
e.g.
false <TAB> Item does not exist.
Successful return:
JSON output object: { "status" : true, "item_info" : { "property1" : "value1", "property2" : "value2", "property3" : "value3", ... } } Most of field values will be represented simply as "fieldname":"simple-value" pair, in the root "item_info" property. For field value of "ucar", a sub-JSON object will represent it. (A sample is shown below.) "ucar" : { <taskKeyword>: { "level":<integer>, "groups":{ <groupname>:<0/1>,... }, "taskdescription":<desc-of-task> }, <taskKeyword>: { "level":<integer>, "groups":{ <groupname>:<0/1>,... }, "taskdescription":<desc-of-task> }, <taskKeyword>: { "level":<integer>, "groups":{ <groupname>:<0/1>,... }, "taskdescription":<desc-of-task> }, : }
Unsuccessful return:
JSON output object: { "status" : false, "errmsg" : "error message, if status is false" }