Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
eliotcole
6 years agoExplorer | Level 4
Programmatically Process Shared Link Folders and Sub-Folders and Their Contents
Well I'm still at a loss.
I have the shared link to a folder that I need to check on a daily schedule to see if there's new files. The logic of which is all fine, but I just can't access anythi...
eliotcole
6 years agoExplorer | Level 4
Hi, Greg-DB , cheers ... I mean ... it sounds like it should ... but now I'm just hit with more issues.
I'm starting from scratch, and when I run the code that you gave with the URL I now get this error:
Error in call to API function "files/list_folder": request body: shared_link: unknown field 'path'
Greg-DB
Dropbox Community Moderator
6 years agoIt sounds like you accidentally moved a "}" when copying in your shared link. The "path" parameter should be a top-level parameter, not part of the "shared_link" parameter object.
- eliotcole6 years agoExplorer | Level 4
You're quite right, cheers muchly, mate! :ThumbsUpAll: !! That managed to list the folder. Although, I don't think I would've *ever* worked that out from the documentation. :weary:
However all that said, I'm still not seeing any URL that I can use externally in any of those details, since experience has shown that the link plus the folder will not be a link that works in a browser.
Should I parse the parent_shared_folder_id in a file that's contained in the subfolder to then perform a folder metadata call with it to get the url?
I feel like that's going to be problematic if the folder is empty, though. Additionally, it would seem like a bit of a round the houses way to get links to subfolders.
Greg-DB wrote:It sounds like you accidentally moved a "}" when copying in your shared link. The "path" parameter should be a top-level parameter, not part of the "shared_link" parameter object.
- Greg-DB6 years ago
Dropbox Community Moderator
The /2/files/list_folder response doesn't include shared links for entries, nested or not. It does include the normal File/FolderMetadata for the entries though, so you can use that metadata in your app. To step back a bit though, what functionality are you trying to build?
For example, if you then want to programamtically download a file from one of the subfolders, you can then use /2/sharing/get_shared_link_file with the original main shared link and relevant relative path again to do so.
Alternatively, if you do just want the nested shared link itself, e.g., to hand off to the user to display in the browser, that isn't available on the API. Let me know if that's the end goal and I'll pass it along as a feature request though.
- eliotcole6 years agoExplorer | Level 4
Hi, Greg
Thanks again!
Basically, yeah, that's the goal, so it'd be awesome if you could pass that on as a feature request.
I will accept the latest answer as a solution, but I think it's an amalgam of them all.
I think one of the issues with my previous code was that I was *completely* unaware of the "shared_link" part, which didn't seem to jump out at me whilst perusing the docs, but maybe I'm blind!
Would it be possible to use some combination of any of this with any of the online automation tools, such as Microsoft's powerful Power Automate stuff? Or maybe automate.io's much improving interface?
Oh, and in a while I'll come back and edit this post with some view on what I've put together so it's cogent.
E
Greg-DB wrote:The /2/files/list_folder response doesn't include shared links for entries, nested or not. It does include the normal File/FolderMetadata for the entries though, so you can use that metadata in your app. To step back a bit though, what functionality are you trying to build?
For example, if you then want to programamtically download a file from one of the subfolders, you can then use /2/sharing/get_shared_link_file with the original main shared link and relevant relative path again to do so.
Alternatively, if you do just want the nested shared link itself, e.g., to hand off to the user to display in the browser, that isn't available on the API. Let me know if that's the end goal and I'll pass it along as a feature request though.
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!