We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
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,877 PostsLatest Activity: 12 months 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!