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
sirhoe
3 years agoNew member | Level 2
Dropbox API: How to check if user can create shared link without calling create_shared_link_with_set
I build an app and I am would like to proactively inform the user they could not create shared link on a file/folder without them clicking the button and handling the error.
My question is, what API should I check to achieve that?
The errors returned by sharing/create_shared_link_with_settings give you a good sense of the primary cases to check for.
- Users must have their email verified in order to share links - else they receive an email_not_verified error. You can check for email verification in users/get_current_account
- A link may already exist on the file for the user, in which case you may receive a shared_link_already_exists error. You can call sharing/list_shared_links on a path to determine if a link is already present.
- If content is within a shared folder, the folder owner may have enabled settings that prevent shared links on the content. You may inspect the settings of a shared folder with sharing/get_folder_metadata
- Some (non-default) link creation settings are not available to some account types (for example, basic accounts cannot set expiry times). This is described in more detail in the create link method, and account type returned in get account
There are potentially rarer exceptions that may cause creating a link to fail that are less introspect-able; you will still want to error handle any 409's from the call.
- kyleaDropbox Staff
The errors returned by sharing/create_shared_link_with_settings give you a good sense of the primary cases to check for.
- Users must have their email verified in order to share links - else they receive an email_not_verified error. You can check for email verification in users/get_current_account
- A link may already exist on the file for the user, in which case you may receive a shared_link_already_exists error. You can call sharing/list_shared_links on a path to determine if a link is already present.
- If content is within a shared folder, the folder owner may have enabled settings that prevent shared links on the content. You may inspect the settings of a shared folder with sharing/get_folder_metadata
- Some (non-default) link creation settings are not available to some account types (for example, basic accounts cannot set expiry times). This is described in more detail in the create link method, and account type returned in get account
There are potentially rarer exceptions that may cause creating a link to fail that are less introspect-able; you will still want to error handle any 409's from the call.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 11 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!