We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Gonzo345
9 years agoHelpful | Level 5
Getting the shared link using the deprecated GetSharedLinksAsync(path)
Hi there! I'm facing problems retrieving a shared link which is already created. I'm basically trying to "create" the Shared Link every time I upload a file and storing that URL on a DB but I'm s...
- 9 years ago
If a shared link already exists for a file or folder, you can use ListSharedLinksAsync with path as the path to the desired file or folder and directOnly=true to get the existing link.
Greg-DB
Dropbox Community Moderator
9 years agoIf a shared link already exists for a file or folder, you can use ListSharedLinksAsync with path as the path to the desired file or folder and directOnly=true to get the existing link.
- Gonzo3459 years agoHelpful | Level 5
Hi again, Greg the Dropmaster! Thank you so much, I finally did it this way, so I control if the link is already created and act if so :slight_smile:
var link = await dbx.Sharing.ListSharedLinksAsync(remoteFilePath); if(link.Links.Count == 0) {
var result = await dbx.Sharing.CreateSharedLinkWithSettingsAsync(remoteFilePath); string url = result.Url; Console.WriteLine("The url for sharing " + remoteFilePath + " is: " + url); } else { string url = link.Links[0].Url; Console.WriteLine("(ALREADY GENERATED) The url for sharing " + remoteFilePath + " is: " + url); }You made my friday, Greg! :sunglasses:
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!