We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
quocvu
9 years agoExplorer | Level 3
Best way to get a file's URL
There are photos in shared folder that I have access to. I would like to get the URL of the photos (the JPEG/PNG) in that folder using the V2 NodeJS API. I am able to enumerate the files in the ...
Greg-DB
Dropbox Community Moderator
9 years agoYou can use sharingCreateSharedLinkWithSettings to make a shared link for any file or folder:
https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingCreateSharedLinkWithSettings__anchor
Or, if the shared link already exists, you can use sharingListSharedLinks to retrieve it:
https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingListSharedLinks__anchor
(You may want to use SharingListSharedLinksArg.direct_only to restrict that call to the specific item only.)
https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingCreateSharedLinkWithSettings__anchor
Or, if the shared link already exists, you can use sharingListSharedLinks to retrieve it:
https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingListSharedLinks__anchor
(You may want to use SharingListSharedLinksArg.direct_only to restrict that call to the specific item only.)
- pigelectric9 years agoNew member | Level 2As you mention, a shared link must exist for the sharing-list-shared-links to retrieve it.
The issue I am facing is trying to get a shared link to generate for all files in a folder. I tried using the sharing-create-shared-link with settings API but it only seems to generate the shared link on a folder or individual file basis.
How do I get every file in a folder to have a shared link, without having to go through each file one by one?
THANK YOU- Greg-DB9 years ago
Dropbox Community Moderator
There isn't a way to create a shared link for every file in a folder without making a call for each one unfortunately. You'll need to list the files and call sharingCreateSharedLinkWithSettings on each one.- pigelectric9 years agoNew member | Level 2
Oh darn, I was thinking that might be the case. Is there a way to automate that ?
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!