Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.
Forum Discussion
larschassing
9 years agoHelpful | Level 6
Sharing an app folder
I would like to create an iOS app that saves some voice recordings into an app folder.
Then the iOS app should mail a link to the app folder to other users, who (using the same iOS app) should be able to listen to the recordings.
1) Using Swiftydropbox I cannot create a shared link to the app folder, "" is not supported, I can only obtain a link to a specific file like "/Recording1.m4a".
2) I cannot use Swiftydropbox with just such a link to download the file.
I would like to be able to pass a link to the app folder to Swiftydropbox and use it for downloading new recordings.
Would that be possible?
- Unfortunately the Dropbox API just happens to not have the particular functionality you're looking for. I've sent this along as feedback, but I can't promise if or when any of this functionality would be implemented.
9 Replies
Replies have been turned off for this discussion
- Greg-DB9 years ago
Dropbox Community Moderator
1. The Dropbox API doesn't allow an app with the app folder permission to create a shared link for its own app folder. Instead, you could make a subfolder, e.g., "/Recordings" (or whatever you'd like), and then get a shared link for that folder.
2. You can download the file from a shared link using the getSharedLinkFile method. Note that if you supply the link to a folder, you'll also need to know the sub-path of the specific file you want, and supply it to the "path" parameter..
- larschassing9 years agoHelpful | Level 6
Thank you for the quick reply.
1. Yes, I also thought of the idea of creating a dummy folder
What is the reason that the Dropbox API doesn't allow an app with the app folder permission to create a shared link for its own app folder?
2. But don't you still need to authenticate to use the getSharedLinkFile ?
In my app I would like record, login and upload a recording to Dropbox, then mail a shared link to the recording folder to my friend.
My friend would like to initialize Swiftydropbox with the shared link to my folder, not login but just enumerate the files in the folder including metadata rev, and then download any new/changed files using the otherwise very useful and well designed Swiftydropbox framework.
- Greg-DB9 years ago
Dropbox Community Moderator
1. The Dropbox API doesn't support creating a shared link for the root path, but I'll be sure to pass this along as a feature request. (In the case of an app folder app, the app folder itself is "root".)
2. Yes, the getSharedLinkFile does require user auth, so it sounds like that won't be a good solution for you.
Alternatively, if you send links for individual files instead of the folder itself, you can modify the links for direct file access, without using the API:
https://www.dropbox.com/help/201 - larschassing9 years agoHelpful | Level 6
1. Great, thanks
2. Do you know if it is at all possible to obtain metadata (rev, clientModified, serverModified, etc.) for a shared link ?
Or to enumerate files in a shared folder ?
If not, then Dropbox might not be the platform for me.
The idea is, that my friend would occasionally check the link to my app folder to see if I have made any new recordings or modified one.
Using the powerful SwiftyDropbox at my friends side would have been extremely useful to me.
I hope you understand the functionality I'm seeking, and you will consider if it is something Dropbox will support
Thanks,
/Lars
- Greg-DB9 years ago
Dropbox Community Moderator
2. You can use getSharedLinkMetadata to get the metadata, but that also requires user auth, like getSharedLinkFile.
The API unfortunately doesn't offer a way enumerate the contents of a folder via a shared link for the folder.
- larschassing9 years agoHelpful | Level 6
I get the feeling that my suggested scenario in some way violates the business model of Dropbox.
Why isn't it possible for my friend to see the files including metadata in my app folder without auth ?
- Greg-DB9 years ago
Dropbox Community Moderator
Unfortunately the Dropbox API just happens to not have the particular functionality you're looking for. I've sent this along as feedback, but I can't promise if or when any of this functionality would be implemented. - larschassing9 years agoHelpful | Level 6
Hi Greg,
thank you for your help and considerations.
I sincerely hope that the functionality I'm seeking is reasonable and that you will support it in the great SwiftyDropbox
Thanks,
/Lars
- Greg-DB8 years ago
Dropbox Community Moderator
Dropbox API v2 now supports listing the contents of a shared link for a folder. This can be accomplished using the same interface as listing a folder in a connected user's account, via the list_folder functionality. To list the contents of a shared link for a folder, you instead provide the shared link URL in the `shared_link` parameter to list_folder:
https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
If you're using an official SDK, there will also be a corresponding method for this endpoint:
In the Swift SDK that's available as `listFolder`:
https://dropbox.github.io/SwiftyDropbox/api-docs/latest/Classes/FilesRoutes.html#/s:13SwiftyDropbox11FilesRoutesC10listFolderAA10RpcRequestCyAA0C0C04ListF16ResultSerializerCAH0if5ErrorK0CGSS4path_Sb9recursiveSb16includeMediaInfoSb0O7DeletedSb0O24HasExplicitSharedMembersSb0O14MountedFolderss6UInt32VSg5limittF
Note that this only supports user authentication, not app authentication, so you will need an access token to make this call. Support for app authentication for this is open as a request with the team, but I can't promise if/when that would be implemented.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,039 PostsLatest Activity: 20 hours ago
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 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!