Questions regarding the BOX API
回答済みHello dear BOX Developers,
we are currently implementing a BOX Integration for the CI HUB Panel (found here: https://exchange.adobe.com/creativecloud.details.103590.ci-hub-connector.html )
While developing we encountered two problems:
#1 Predefined “Custom Metadata” Template:
In the metadata-section for an asset, there is the possibility to set a predefined metadata template “Custom Metadata” and specify key & value pairs in there.
We would like to display these fields (e.g. Key: ExampleKeyValue1, Value: ExampleValue) in the CI-HUB Panel, but we couldn’t find a way to receive them from your API.
Could you help us here?
#2 Shared-Assets in the „Recents” Section
We would like to display and download the Assets, which are located in the “Recents” Tab. This works perfectly fine with assets which are not shared.
The problem we encountered is related to shared assets which are NOT shared over a direct link to a single asset, but over a shared folder.
For example:
This asset:
Is shared over a direct link. We can build a download URL with no problem, because left-click this asset box redirects me directly to the Asset “model.jpg”. The only Problem here is that we could not receive a valid thumbnail URL for this asset.
The url we receive through the represntations field for an item is invalid if the item is received through a shared link
This asset:
Is shared over a shared folder and is part of the resultset of “Recents”. If we left-click on this asset, we are redirected to what seems to be the root of the shared folder the asset is stored in.
Our mechanism for downloading an asset via the id of the asset which is contained in the resultset is broken with this case. How could we directly access an asset and its thumbnail when the shared link is mapped to a folder?
Best regards,
Leon Schäfer
-
Hi Leon
For the first issue. The 'Custom metadata' uses the global 'properties' template, You can retrieve using this API
https://api.box.com/2.0/files/<fileId>/metadata/global/propertiesFor the second issue. You could try the https://developer.box.com/reference/get-shared-items/ endpoint
This takes a shared link in the BoxApi header and will return the full JSON of the file represented by the shared linkBest regards, Peter Christensen, Platform Solutions Engineer, Box
-
Hi Peter,
thank you for your answer.
For the first issue:
The link https://api.box.com/2.0/files/<fileId>/metadata/global/properties doesnt work for me (i am signed in). Maybe this is not public?
For the send issue:
This could lead to too many calls since we would like to recieve all the files stored in "recents". But if this is the only solution we maybe give it a try.
Best regards, Leon Schäfer
-
Hi Leon
The https://api.box.com/2.0/files/<fileId>/metadata/global/properties link is to an API so you would need to run it in postman or cURL or similar with an authorization header and a valid file ID. Like below
curl -i -X GET "https://api.box.com/2.0/files/12345/metadata/global/properties" \ -H "Authorization: Bearer <ACCESS_TOKEN>"
Rgds,
Peter
サインインしてコメントを残してください。
コメント
3件のコメント