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 🙂