We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Mark L.45
10 years agoCollaborator | Level 9
Shared Links in SwiftyDropbox broken?
Running this function using SwiftyDropbox! Was working well til this morning, now it returns nothing useful, just the reply that the link already exists, and when I try and get the link... it returns...
Mark L.45
10 years agoCollaborator | Level 9
Hi Greg,
Printed the errors, so I try to create a shared link. It fails with ...
sharing_create_linkV2 /acme201/acmeSINGLE/acmeX101.001.png
error Optional([request-id abc63bdac24b4afe306dae1d] API route error - {
".tag" = "shared_link_already_exists";
})
I ask for the shared link and I get...
error Optional([request-id 18b2cd24390e59cf83cedcef] API route error - {
".tag" = "shared_link_not_found";
}) source /acme201/acmeSINGLE/acmeX101.001.png response.0 nil response.1 nil 0
,/acme201/acmeSINGLE/acmeX101.001.png,0
Maybe I am asking the wrong question. I used the same string in both create link and return link API calls; but I am unclear if the API really works that way. The string I supply is the one you see here in bold/italics. Create shared link wants a PATH, and yet get shared link suggests it needs a URL?
What do I need to add an HTTP://something? to the PATH when I call client.sharing.getSharedLinkFile API
- Mark L.4510 years agoCollaborator | Level 9*** STOP PRESS *** Managed to find a solution, used this code that works.
_ = client.sharing.listSharedLinks(path:sourcePath,cursor:nil,directOnly:false).response(queue: DispatchQueue(label: "MyCustomSerialQueue")) { response, error2 in
print("data error \(error2) source \(sourcePath) response.0 \(response?.links[0].url) \(posIndex)")
sharedDataAccess.fnLink(index2seek: posIndex, fnLink: (response?.links[0].url)!)
sharedDataAccess.fnPos(index2seek: posIndex, fnPos: posIndex)
}- tim10 years agoExplorer | Level 4
Just a note: if your code deals with a file that's in a folder which is also shared, then links[0].url will exist and be the shared link of the folder, not the file. If you want it to only return direct shared links, rather than use an ancestor's link, then specify directOnly as true.
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!