We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

Simone11's avatar
Simone11
Explorer | Level 4
6 years ago

Dropbox for Business API Access token login process.

Hi There. I have an iOS apllication written in Objective-C. I have successfully integrated Dropbox API in my app and I can upload and download data from dropox even using the Access Token for it.  ...
  • Greg-DB's avatar
    6 years ago

    If you have a Dropbox Business API access token for an app with the "team member file access" permission and want to programmatically access a specific member's account using the Dropbox Objective-C SDK, you should use the DBTeamClient userClientWithMemberId: method. That will give you a DBUserClient you can use to access the user methods, such as listFolder. (It sets the "Dropbox-API-Select-User" header mentioned in the error message you shared.)

    That would look like this:

    DBTeamClient *teamClient = [[DBTeamClient alloc] initWithAccessToken:ACCESS_TOKEN];
    DBUserClient *userClient = [teamClient userClientWithMemberId:memberID];
    
    [[userClient.filesRoutes listFolder:path]
     setResponseBlock...

    The member ID would be the team member ID (which starts with "dbmid:"). You can get those from membersList/membersListContinue, for instance.

    Also, note that client-side applications, such as on iOS, can't keep secrets, such as access tokens, from a malicious user. For that reason, we don't recommend sharing/hard-coding access tokens in client-side applications. For example, in your described scenario, one team member could potentially extract the access token and use it to access another member's account.