Skip to main content

Unable to fetch shared documents

  • September 18, 2023
  • 9 replies
  • 232 views

  • Known Participant
  • 12 replies

Hi,

While fetching files from user of my organization. I am unable to fetch shared documents which is shared by user which is not in my organization. So, is it expected behavior. Also, in total count it displayed count with shared files but in entries it did not return the shared files.

9 replies

  • Author
  • Known Participant
  • 12 replies
  • September 18, 2023

I am getting below response:


{

    "total_count": 7,

    "entries": [

        {

            "type": "folder",

            "id": "1",

            "etag": "0",

            "name": "folder-1"

        },

        {

            "type": "folder",

            "id": "2",

            "etag": "0",

            "name": "folder-2"

        },

        {

            "type": "folder",

            "id": "3",

            "etag": "0",

            "name": "folder-3"

        },

        {

            "type": "folder",

            "id": "4",

            "etag": "0",

            "name": "folder-4"

        },

        {

            "type": "file",

            "id": "5",

            "etag": "0",

            "name": "file-1"

        },

        {

            "type": "file",

            "id": "6",

            "etag": "0",

            "name": "file-2"

        }

    ],

    "offset": 0,

    "limit": 1000,

    "order": [

        {

            "by": "type",

            "direction": "ASC"

        },

        {

            "by": "name",

            "direction": "ASC"

        }

    ]

}


Here you can saw that total_count was 7 but I am getting only 6 entries as 1 was shared by user which is not in my organization.


  • Author
  • Known Participant
  • 12 replies
  • September 19, 2023

Hi Everyone,

Any luck with this issue? I am stuck with this issue.


CC: @rbarbosa, @smartoneinok


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 19, 2023

Hello,


What endpoint are you using? Can you tell me more about how you are going about calling for the files? I did some testing and I’m seeing files from other organizations returned.


Thanks,

Alex, Box Developer Advocate


  • Author
  • Known Participant
  • 12 replies
  • September 19, 2023

Hello @smartoneinok, I am using “https://api.box.com/2.0/folders/0/items” API to list all items available in root folder.


To Reproduce,

I have created access token with my admin account using CCG. Now I am trying to fetch files of user-1’s root folder using as-user header parameter.


Here, user-2 has shared one file to user-1 but “user-2 is not in my organization (It’s free Account)”. So, currently user-1 have 4 folders and 3 files in his root folder (one is shared by user-2). But in response i got total_count=7 which is correct, but in entries i am getting only 6 entries.


App configuration:


App Access Level: App + Enterprise Access

Application Scopes:




NOTE: In Content Section of Admin console I am not able to see that file.


I think it’s related to permissions.


  • Author
  • Known Participant
  • 12 replies
  • September 20, 2023

Hey @smartoneinok 👋, Did you get a chance to look at this issue.


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 20, 2023

Hello - still investigating.


If you login as User 1 from the web app, do you see the file there?


  • Author
  • Known Participant
  • 12 replies
  • September 21, 2023

Yes, I am able to see that with User 1 creds.


  • Author
  • Known Participant
  • 12 replies
  • September 25, 2023

hey, are you able to reproduce this ?


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 25, 2023

Hi - yes I reproduced it. I created a ticket with our internal system team. I suspect that is is not a supported feature of the API. I will let you know when I hear back.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings