Now I have been so far successful listing the users in a dropbiox business account and listing their files and folders successfully
Some snippets of code related to it are
- List users: https://api.dropboxapi.com/2/team/members/list_v2
- Fetch team_member_id for these users
- Create dropbox client using
const dbx: any = new Dropbox({
accessToken: access_token,
fetch: fetch,
selectUser: team_member_id
});- Recursively call below to get all files and folders for that particular team member. Please note the access token is obtained using oauth flow using admin account
if (cursor === "") {
result = await retry(() => dbx.filesListFolder({ path: "", recursive: true }));
} else {
result = await retry(() => dbx.filesListFolderContinue({ cursor }));
}Now I need to list all the team folders and its content too along with user specific content For it I tried
- Getting list of team folders using : const teamFolderUrl = 'https://api.dropboxapi.com/2/team/team_folder/list';
- Get the team_folder_id
- Create dropbox client using
const dbx: any = new Dropbox({
accessToken: access_token,
fetch: fetch,
});- Recursively call below to get all files and folders for that particular team member. Please note the access token is obtained using oauth flow using admin account
if (cursor === "") {
result = await retry(() => dbx.filesListFolder({ path: "/team_folder", recursive: true }));
} else {
result = await retry(() => dbx.filesListFolderContinue({ cursor }));
}but I am getting error
error: `Error in call to API function "files/list_folder": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user <https://www.dropbox.com/developers/documentation/http/teams>.`
require your help in detailed understanding of the issue