You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
JuliaNowicka
3 years agoExplorer | Level 4
Check if user shared any links
Hello, I need to check how many links user has shared and how many of them are public links. Is this possible using the Dropbox API? I'm using the get_shared_links endpoint at the moment, but I'm not...
- 3 years ago
For a user not on a team with a team space, you can just use sharing_list_shared_links, without setting the path root, to get all the shared links for that user, since their member folder is their root anyway.
For a user on a team with a team space, you should still use sharing_list_shared_links, but you would need to set the path root to their team space if you need to list all their shared links, including those in both their team space and member folder.
This code should illustrate how to count all shared links for either type, checking for and rooting from a team space if present:
dbx = dropbox.Dropbox(ACCESS_TOKEN) current_account = dbx.users_get_current_account() if isinstance(current_account.root_info, dropbox.common.TeamRootInfo): dbx = dbx.with_path_root(dropbox.common.PathRoot.root(current_account.root_info.root_namespace_id)) links = [] res = dbx.sharing_list_shared_links() links += res.links while res.has_more: res = dbx.sharing_list_shared_links(cursor=res.cursor) links += res.links print(len(links))
Здравко
3 years agoLegendary | Level 20
Documentation:List shared links of this user. If no path is given, returns a list of all shared links for the current user. For members of business teams using team space and member folders, returns all shared links in the team member's home folder unless the team space ID is specified in the request header.
Have you passed any parameters restricting the set of links? 🧐😉
- JuliaNowicka3 years agoExplorer | Level 4
No, as I call it for each user on the team, so I'm not sure what that would be. 😅
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 18 hours agoIf 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!