How to get metadata information of files using search api
Hi All,
I am trying a solution to get metadata information of files using search api call. I have tried to pass metdata in fields section.
But not getting the files meta data information. Following is my api call and results array. Now i need to make another api calls for to get metadata information.
I want to implement this with one api call. Can anybody help to get files metadata information using search api.
API Call:
{ "type": "file", "id": "22***phone number removed for privacy***", "etag": "0", "name": "ACCT516_W14-15_RL_PIOTROSKI.pdf", "metadata": null },
Thanks,
Vijeesh
-
Hi Vijesh,
as described here you should place your search in a JSON object like so:
?mdfilters=[{"templateKey":"marketingCollateral", "scope":"enterprise", "filters":{"documentType": "datasheet"}}]
Hope this helps.
-
Thank you for your reply. This is not helping to solve my issues. My exact requirement like this, with one Box api call i need to get all files with metadata information of each file. Currently i need to make two calls, its making performance issue, the 100 records result displaying with 100 seconds.
Its not acceptable with any website.
Do you have any idea about Box api method to search the files and fetch all metadata information's in one api call. Currently getting metadata of each file with individual api call.
-
as described in this other forum post (https://community.box.com/t5/Platform-and-Development-Forum/Search-API-feature-for-fetching-all-files-metadata-information/m-p/63154) you need to specify the metadata template in the `fields` parameter
example
curl -H"Authorization: Bearer ACCESS_TOKEN" https://api.box.com/2.0/search?query=Test&fields=name,metadata..
Please sign in to leave a comment.
Comments
3 comments