cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Musicians, convert your MuseScore files to PDF to play music on the go! Learn more here.

Discuss Dropbox Developer & API

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

finding the path of shared folders

finding the path of shared folders

prabhat1999
Explorer | Level 3

I am using  dbx.sharing_list_folders() function to get all the shared folder and using folder_metadata= dbx.sharing_get_folder_metadata(shared_folder.shared_folder_id) to get the meta data of the shared folder and from this object i am retreving folder path using folder_metadata.path_lower  but it is giving None.

guide me to fetch folder path of the shared Folders

1 Reply 1

iNeil
Dropbox Engineer

Hello @prabhat1999 ,

 

If your account has the updated team configuration and you are not using the Dropbox-API-Path-Root header with the Dropbox API, the team folders and any folders nested within them won’t return the path_lower field. Additionally, if your shared folder is unmounted, it won't return the path_lower field either. This could be the reason why your path_lower value is “None”.

 

That said, you could use the sharing_list_folders method directly to retrieve some of your path_lower values instead of looping the sharing_get_folder_metadata method with the shared_folder_id. Below I have provided an example code snippet while using the Dropbox-API-Path-Root header.

 

# Create a Dropbox instance with an access token and using the Dropbox-API-Path-Root header
dbx = dropbox.Dropbox('ACCESS_TOKEN')
root_namespace_id = dbx.users_get_current_account().root_info.root_namespace_id
dbx = dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id))
    
# Call the sharing_list_folders method
result = dbx.sharing_list_folders()

# Print the list of shared folders path lower value
for entry in result.entries:
    print(entry.path_lower)

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    iNeil Dropbox Engineer
What do Dropbox user levels mean?