You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
himanshu_jha
7 years agoExplorer | Level 3
Java API for Team Folder Operations
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/271239
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.
- Greg-DBDropbox Staff
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.
- himanshu_jhaExplorer | Level 3
Thank you Greg K. for quick response.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 13 hours agoIf 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!