4

I'm integrating Box into an iOS app using the Box v2.0 api.

The first problem I've hit is that the response to API calls for "entries" by the "folders" api request is too limited. What the api currently returns for each folder "entry" is something like:

"entries" : 
[
    {
        "sequence_id": "0",
        "type": "file",
        "id": "2631999573",
        "name":"IMG_1312.JPG"
    },
    {
        "type":"folder",
        "id":"2305623799",
        "sequence_id":"1",
        "name":"a child folder"
    }
]

This means that to retrieve basic metadata (size, modification date etc) for a child entry I have to issue a REST request for each item. This is clearly very inefficient.

Is there a way to get richer metadata in the "folders/" response? It could be filtered by providing a suitable query in the request. e.g.

GET /folders/980980989?fields=name,id,type,size,modified_at
Peter
  • 2,551
  • 1
  • 14
  • 20
John
  • 191
  • 6
  • George: Box.com use stackoverflow as their developer "forum". I was asking for clarification regarding their "folders" v2 REST API method. – John Aug 09 '12 at 10:00

2 Answers2

4

@auny

That's very, very inefficient. For example our iOS app is a file viewer - when a user navigates to a Box directory they see a list of all files in that directory (in a table view). The view is backed up by a local "model" which stores basic file metadata (name, size, modification date etc). Each file displays it's name, size and modification date.

With the v2 api Box are expecting us to make a separate REST api call for each file in a directory (could be 100s, 1000s or more) simply to determine size and modification date. This is just massively inefficient for a mobile app.

Don't forget that often with mobile it's latency (not bandwidth) which affects performance. Ok, bandwidth may not be great either, but the latency of 100s of REST calls will be a major problem.

1 REST call to determine basic metadata for a directory, even if that entails a few more KB in the response, is vastly preferable to 100s of separate REST calls.

The folders response is already providing some metadata for each directory entry, it would not be hard to include additional fields, even if these were only available by request.

Crazy.

John
  • 191
  • 6
-1

Yes you have to query each sub-item to get its info in V2.There is no other way

auny
  • 1,920
  • 4
  • 20
  • 37