We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

HristoYordanov's avatar
HristoYordanov
Explorer | Level 4
2 years ago

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

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 πŸ™‚

 


  • 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).

    ...


    Здраси Π₯ристо,

    Имаш ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌ с Π½Π°ΠΌΠΈΡ€Π°Π½Π΅Ρ‚ΠΎ Π½Π° Ρ‚Π°ΠΊΡŠΠ² ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ просто Π·Π°Ρ‰ΠΎΡ‚ΠΎ Ρ‚Π°ΠΊΡŠΠ² няма. πŸ˜‰ ΠŸΡ€Π°Π²ΠΈ Ρ€Π°Π·Π»ΠΈΠΊΠ° ΠΌΠ΅ΠΆΠ΄Ρƒ сподСлСна дирСктория ΠΈ ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½Π° дирСктория! Π‘Π°ΠΌΠΎ (пряко) сподСлСната дирСктория ΠΈΠΌΠ° Ρ‚Π°ΠΊΡŠΠ² ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€. Всяка Π΄Ρ€ΡƒΠ³Π° ΠΈΠΌΠ° само ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ Π½Π° дирСктория (Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚Π΅Π»Π½ΠΎ ΠΈ Π½Π°ΠΌΠΈΡ€Π°Ρ‰ΠΈΡ‚Π΅ сС ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ Π²Π»ΠΎΠΆΠ΅Π½ΠΈ Π² сподСлСна Ρ‚Π°ΠΊΠ°Π²Π°), Π±Π΅Π· ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎ Π½Π° сподСлСна дирСктория (просто Π·Π°Ρ‰ΠΎΡ‚ΠΎ Π½Π΅ Π΅ сподСлСна, ΠΏΠΎΠ½Π΅ Π½Π΅ пряко). Π—Π° удобство ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΡ‚Π΅ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ Π²Π»ΠΎΠΆΠ΅Π½ΠΈ Π² сподСлСна ΠΈΠΌΠ°Ρ‚ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ΠΈ сочСщи Π½Π°ΠΉ-Π±Π»ΠΈΠ·ΠΊΠ°Ρ‚Π° ΠΎΠ±Ρ…Π²Π°Ρ‰Π°Ρ‰Π° сподСлСна дирСктория, Π½ΠΎ Π½ΠΈΡ‰ΠΎ ΠΏΠΎΠ²Π΅Ρ‡Π΅!

    Надявам сС, Ρ‡Π΅ Π³ΠΎΡ€Π½ΠΎΡ‚ΠΎ Π΄Π°Π²Π° някакви насоки.


  • 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).

    ...


    Здраси Π₯ристо,

    Имаш ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌ с Π½Π°ΠΌΠΈΡ€Π°Π½Π΅Ρ‚ΠΎ Π½Π° Ρ‚Π°ΠΊΡŠΠ² ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ просто Π·Π°Ρ‰ΠΎΡ‚ΠΎ Ρ‚Π°ΠΊΡŠΠ² няма. πŸ˜‰ ΠŸΡ€Π°Π²ΠΈ Ρ€Π°Π·Π»ΠΈΠΊΠ° ΠΌΠ΅ΠΆΠ΄Ρƒ сподСлСна дирСктория ΠΈ ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½Π° дирСктория! Π‘Π°ΠΌΠΎ (пряко) сподСлСната дирСктория ΠΈΠΌΠ° Ρ‚Π°ΠΊΡŠΠ² ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€. Всяка Π΄Ρ€ΡƒΠ³Π° ΠΈΠΌΠ° само ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ Π½Π° дирСктория (Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚Π΅Π»Π½ΠΎ ΠΈ Π½Π°ΠΌΠΈΡ€Π°Ρ‰ΠΈΡ‚Π΅ сС ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ Π²Π»ΠΎΠΆΠ΅Π½ΠΈ Π² сподСлСна Ρ‚Π°ΠΊΠ°Π²Π°), Π±Π΅Π· ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎ Π½Π° сподСлСна дирСктория (просто Π·Π°Ρ‰ΠΎΡ‚ΠΎ Π½Π΅ Π΅ сподСлСна, ΠΏΠΎΠ½Π΅ Π½Π΅ пряко). Π—Π° удобство ΠΎΠ±ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΡ‚Π΅ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ Π²Π»ΠΎΠΆΠ΅Π½ΠΈ Π² сподСлСна ΠΈΠΌΠ°Ρ‚ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ΠΈ сочСщи Π½Π°ΠΉ-Π±Π»ΠΈΠ·ΠΊΠ°Ρ‚Π° ΠΎΠ±Ρ…Π²Π°Ρ‰Π°Ρ‰Π° сподСлСна дирСктория, Π½ΠΎ Π½ΠΈΡ‰ΠΎ ΠΏΠΎΠ²Π΅Ρ‡Π΅!

    Надявам сС, Ρ‡Π΅ Π³ΠΎΡ€Π½ΠΎΡ‚ΠΎ Π΄Π°Π²Π° някакви насоки.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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's avatar
    HristoYordanov
    Explorer | Level 4

    Thank you guys for your answers and time.

    Seems that it will be the hard way πŸ™‚

     

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

     

    Wish you all good.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!