新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

Get Collaborations on File is always empty

回答済み
新規投稿

コメント

9件のコメント

  • LoCortes

    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

    0
    コメントアクション Permalink
  • hgL0r11e

    Hello ,

     

    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 didn't understand the question about the application scope. Can you briefy explain what did you mean?

    Thank you

    0
    コメントアクション Permalink
  • hgL0r11e

    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 😞

    0
    コメントアクション Permalink
  • LoCortes

    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,

    0
    コメントアクション Permalink
  • LoCortes

    Hello again!

     

    I have done a PoC and yes, it is that the reason that you do not have collaborators. Files on root folder have no collaborators, are exclusively yours.

     

    collaboratorsEmpty.png

     

    Regards,

    0
    コメントアクション Permalink
  • hgL0r11e

    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.

    0
    コメントアクション Permalink
  • LoCortes

    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

    0
    コメントアクション Permalink
  • hgL0r11e

    Thank you 

     

    This issue is solved - I have just run a successfull test!

    0
    コメントアクション Permalink
  • LoCortes

    Hello ,

     

    a pleasure! I am glad that it worked 🙂

     

    Regards!

    0
    コメントアクション Permalink

サインインしてコメントを残してください。