Get Collaborations on File is always empty
回答済みHello. Well the issue is laconically described in the Subject. I attach here below an example for a request for one file, but I got exactly the same empty Json object for another file:
Is this me who is doing something terribly wrong or is there an issue with the API for this REST call?
-
Hello ,
I undestand that you are using a developer token generated from the application on the "box Developers" or is a generated token for an APP User?
I understand that the file you are using is within some folder where that user is present as a collaborator. Which role has the user you are using in that folder? Also, which are the application scopes that you have defined on the APP?
Probably some of those configurations are doing that you can not see the collaborations. I have done a test myself with that endpoint and worked fine.
Thanks
-
As a follow-up. I just called the same end-point from within my application and I get exactly the same result 😞 Here's the code (I am using Apache CXF's Web Client). It's just a test, but a test that uses real and actual access token and a real file id:
WebClient client = WebClient.create("https://api.box.com/2.0"); client.path("files/"+id+"/collaborations"); client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); client = client.header("Authorization", "Bearer "+currentTokenBundle.getAccessToken()); String resp = client.get(String.class); client.close();
In the debug mode I checked that the URI and headers are correct. String resp is stringified empty Json collaborations object 😞
-
Hello ,
I think that the key is on this sentence: "I am using a user token (exactly the same that I am using to get the File). The file is owned by the user - it is in their root directory."
I understand that you have created the file directly on the root folder (ID: 0) not under another folder. So... you can not share your root folder, so I understand that it is the reason that you do not have collaborators there 🙂 I would try to create a folder, move the file there, and add some collaborator.
Regards,
-
Hi ,
I think your contribution is very helpful. So please correct me if I am wrong - In Box you can only have collaborators on folders and not files. Thus this endpoint is not accurate. Is what we are really getting is the list of collaborations of the parent folder?
Thank you for your attention to this issue. -
Hello ,
that's right. The security is folder-driven on box, so you can not configure it at document level. The documents inherit collaborations from the parent folder.
So... yeah, the name probably can generate confusion and should be "get-parent-folder-collaborations" 🙂 but probably it is too complex so they have simplified.
Regards
サインインしてコメントを残してください。
コメント
9件のコメント