cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: How to retrieve shared_folder_id of a folder, which inherited access of it's parent?

How to retrieve shared_folder_id of a folder, which inherited access of it's parent?

HristoYordanov
Explorer | Level 4
Go to solution

Hello ppl.


I have an issue retrieving shared_folder_id of a sub folders created via /2/files/create_folder_batch endpoint.

 

My structure:

RootFolder ->  FlowFolder -> ProjectFolder -> SubFolder1 ; SubFolder2 ; SubFolder3

 

An access to FlowFolder is given to two teams - Team1 & Team 2

For each project I'm creating sub folder structure under FlowFolder via /2/files/create_folder_batch endpoint.

All sub folders are inheriting the access given to FlowFolder - Team1 & Team2.

 

What I want to achieve is to restrict the access of SubFolder3 only to Team1 (remove access of Team2) via /2/sharing/remove_folder_member endpoint.

Unfortunately I can not retrieve SubFolder3's shared_folder_id, but only it's parent_shared_folder_id (which refers to FlowFolder).

 

I've tried using the following endpoints as suggested by Greg-DB in other discussions:

  • /2/sharing/get_folder_metadata ;
  • /2/files/get_metadata ;
  • /2/files/search_v2 (searching for SuBFolder3)

, but I can only receive parent_shared_folder_id (FlowFlolder).

 

In addition the /2/files/create_folder_batch endpoint does not have option to select if the freshly created folder are inheriting parent's access or not. Also I'm unable to unshare SubFolder3 and then share it to the proper team (Team1), because /2/sharing/unshare_folder also needs the "shared_folder_id" parameter.

 

Next thing I'm gonna try is using /2/sharing/set_access_inheritance -> "no_inherit" for FlowFolder before /2/files/create_folder_batch and then setting it back to "inherit", then setting proper teams access for each sub folder. But why so complicated? Hope you guys have better solution. 

Please help :slightly_smiling_face:

 

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

@HristoYordanov wrote:

...
I have an issue retrieving shared_folder_id of a sub folders created via /2/files/create_folder_batch endpoint.

...

Unfortunately I can not retrieve SubFolder3's shared_folder_id, but only it's parent_shared_folder_id (which refers to FlowFolder).

...

, but I can only receive parent_shared_folder_id (FlowFlolder).

...


Здраси Христо,

Имаш проблем с намирането на такъв идентификатор просто защото такъв няма. :winking_face: Прави разлика между споделена директория и обикновена директория! Само (пряко) споделената директория има такъв идентификатор. Всяка друга има само обикновен идентификатор на директория (включително и намиращите се обикновени директории вложени в споделена такава), без идентификато на споделена директория (просто защото не е споделена, поне не пряко). За удобство обикновените директории вложени в споделена имат идентификатори сочещи най-близката обхващаща споделена директория, но нищо повече!

Надявам се, че горното дава някакви насоки.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

@HristoYordanov wrote:

...
I have an issue retrieving shared_folder_id of a sub folders created via /2/files/create_folder_batch endpoint.

...

Unfortunately I can not retrieve SubFolder3's shared_folder_id, but only it's parent_shared_folder_id (which refers to FlowFolder).

...

, but I can only receive parent_shared_folder_id (FlowFlolder).

...


Здраси Христо,

Имаш проблем с намирането на такъв идентификатор просто защото такъв няма. :winking_face: Прави разлика между споделена директория и обикновена директория! Само (пряко) споделената директория има такъв идентификатор. Всяка друга има само обикновен идентификатор на директория (включително и намиращите се обикновени директории вложени в споделена такава), без идентификато на споделена директория (просто защото не е споделена, поне не пряко). За удобство обикновените директории вложени в споделена имат идентификатори сочещи най-близката обхващаща споделена директория, но нищо повече!

Надявам се, че горното дава някакви насоки.

Greg-DB
Dropbox Staff
Go to solution

@HristoYordanov Здравко is correct. The new folders do not have a shared folder ID because they are not themselves shared folders. They instead just have a parent shared folder ID because they have a parent that is a shared folder. To manage the sharing of those folders in particular, they would need to be shared separately.

HristoYordanov
Explorer | Level 4
Go to solution

Thank you guys for your answers and time.

Seems that it will be the hard way :slightly_smiling_face:

 

It's a shame for Dropbox that simple action like that could be done under UI, but not using API.

 

Wish you all good.

Need more support?