Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi Team,
I'm using dropbox V2 API with the Java library: dropbox-sdk-java 3.0.8. I would like to have features as below: User (who are part of team) can
i. List Team Folders,
ii. Create Folder inside Team Folder
iii. Upload Files in Team Folders
My question is:
1. For all above functionality, I am using OAuth 2 access token created with a Dropbox API app key and not using Dropbox Business API app key. And all operations are working fine.
However, I am just wondering whether it is the right behaviour? Is it required to use token created using Dropbox Business API app key?
I am reffering these below links:
https://www.dropbox.com/developers/reference/namespace-guide & https://www.dropboxforum.com/t5/API-Support-Feedback/How-to-access-Team-Folders-with-Java-API/td-p/2...
2) Please find code for listing folders & uploading file: Is it correct?
DbxRequestConfig config = new DbxRequestConfig(clientIdentifier);
DbxClientV2 client = new DbxClientV2(config, accessToken);
FullAccount account = client.users().getCurrentAccount();
String rootNS = account.getRootInfo().getRootNamespaceId();
// Display Root Folders including TEAM Folders
ListFolderResult rootFolderResult = client.withPathRoot(PathRoot.root(rootNS)).files().listFolder(path);
// For Uploading File in Team folder
InputStream in = new FileInputStream(uploadFile);
FileMetadata metadata = dbxClient.files().uploadBuilder(dropboxPath)
.withMode(WriteMode.OVERWRITE)
.withClientModified(new Date(uploadFile.lastModified()))
.uploadAndFinish(in);
It sounds like you have the right idea, and your code looks fine.
For reference though, you don't need a Dropbox Business API app to perform these operations. You can also list and upload files using just a Dropbox API app (i.e., non-Business). The choice of what kind of app depends on your use case and requirements and is up to you.
It sounds like you have the right idea, and your code looks fine.
For reference though, you don't need a Dropbox Business API app to perform these operations. You can also list and upload files using just a Dropbox API app (i.e., non-Business). The choice of what kind of app depends on your use case and requirements and is up to you.
Thank you Greg K. for quick response.
Hi there!
If you need more help you can view your support options (expected response time for a 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!