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);