locking - Getting all locked files using the BOX API (BOX.com) -


i trying find solution search/list locked files in box (box.com). seems not possible through user-interface, investigated rest api.

i cannot find way search locked files using api. cannot iterate through api. cannot have wildcard search using "fields=lock" parameter.

currently can query if single file locked by:

https://api.box.com/2.0/files/26802142333?fields=lock 

which returns

{     "type": "file",     "id": "26802142333",     "etag": "462",     "lock": {         "type": "lock",         "id": "22148533",         "created_by": {             "type": "user",             "id": "201274112",             "name": "robert wunsch",             "login": "rwunsch@sapient.com"         },         "created_at": "2015-05-11t11:36:08-07:00",         "expires_at": null,         "is_download_prevented": false     } } 

and can create search using "fields=lock" parameter, query search e.g. containing "xls":

https://api.box.com/2.0/search?query=xls&fields=lock 

which returns

..., {             "type": "file",             "id": "29299819893",             "etag": "0",             "lock": null         },         {             "type": "file",             "id": "26004664251",             "etag": "0",             "lock": null         },         {             "type": "file",             "id": "26004640461",             "etag": "0",             "lock": null         },         {             "type": "file",             "id": "29618844701",             "etag": "3",             "lock": {                 "type": "lock",                 "id": "22002195",                 "created_by": {                     "type": "user",                     "id": "202820453",                     "name": "robert wunsch",                     "login": "gincalua@googlemail.com"                 },                 "created_at": "2015-05-06t05:33:28-07:00",                 "expires_at": null,                 "is_download_prevented": false             }         },         {             "type": "file",             "id": "26004659155",             "etag": "0",             "lock": null         },         {             "type": "file",             "id": "29063166840",             "etag": "0",             "lock": null         }, ... 

how can search locked files?

thanks help!

i don't believe api has way of efficiently retrieving locked files.

the reliable solution walk entire folder tree , check each file see if it's locked. however, slow if have lot of files or deep hierarchy, you'll need make @ least 1 api request per folder.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -