cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want to hear from you. What do you use Dropbox for?
Close

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

adding team functionality to an existing dropbox app

New member | Level 2
New member | Level 2

Hello,  I have an app in the app store,  backpack studio,   that allows access to reading and writing audio  files through dropbox....   I have a user that would like me  to support dropbox "teams" so that they can have the same functionality they have on dropbox.com -  manage their teams individiual (purple) folders and team files  inside the app. 

I'm using the objective-c API and  am able to get this far:

 [DBClientsManager authorizedTeamClient];

 DBTEAMTeamAuthRoutes *routes = teamclient.teamRoutes;

[[routes teamFolderList] setResponseBlock...

I get back: This API function requires a Dropbox Business API app key, but the OAuth 2 access token you provided was created with a Dropbox API app key.  To create a a Dropbox Business API app key, see...

Does that mean that i'm unable to add this functionality  without a creating a separate app designed specifically for business teams?   Or am i simply making the wrong api call to get the folder data?       

    DBTEAMTeamAuthRoutes *routes = teamclient.teamRoutes;

    DBTransportDefaultClient *transportclient = routes.client;

       [[routes teamFolderList] setResponseBlock:^(DBTEAMTeamFolderListResult * _Nullable result, DBTEAMTeamFolderListError * _Nullable routeError, DBRequestError * _Nullable networkError) {

1 Accepted Solution

Accepted Solutions
Highlighted

Re: adding team functionality to an existing dropbox app

Dropboxer
Dropboxer

Yes, that's right. That would use the user's folder, if they're not on a team with a team space, or the team space folder, if they are on a team with the team space. Also, note you can use initWithRoot if you do intend to access the root and want verification mentioned under the "Root" part of the "Dropbox-API-Path-Root Header Modes" section of the Namespace Guide (whereas initWithNamespaceId can be used for any particular namespace the user has access to).

View solution in original post

3 Replies 3
Highlighted

Re: adding team functionality to an existing dropbox app

Dropboxer
Dropboxer

If you just want to be able to access files and folders in their "team space", you don't need to register a "Dropbox Business API" app or use the "teamRoutes". (That's for accessing functionality specific to managing Dropbox Business teams, e.g., adding or removing members.)

You can use your existing "Dropbox API" app with the "full Dropbox" permission to access files in their "team space" (that is, outside their individual purple member folder). API calls default to the member folder though, so you'll need to update your code to specify the team space if/when desired to access it. You can find more information on how this works in the Namespace Guide. That covers how to use the 'Dropbox-API-Path-Root' header to specify the team space.

In the official Dropbox API v2 Objective-C SDK in particular, you can set the 'Dropbox-API-Path-Root' header using the DBUserClient.withPathRoot method.

Highlighted

Re: adding team functionality to an existing dropbox app

New member | Level 2
New member | Level 2

Thank you -  so just to clarify from reading  the namespace guide -  would an objective c implementation that simultaniously supports users on teams and regular users  not on teams work like this: 

 [[client.usersRoutes getCurrentAccount] setResponseBlock:^(DBUSERSFullAccount * _Nullable result, DBNilObject * _Nullable routeError, DBRequestError * _Nullable networkError) {
       //get the root namespace id ... will be the home folder if not on a team 
        NSString *namespaceId = result.rootInfo.rootNamespaceId;
       //create a dbcommonpathroot  with the namespace id 
        DBCOMMONPathRoot *cpr = [[DBCOMMONPathRoot alloc] initWithNamespaceId:namespaceId];
       // make a new client by calling client with the root object 
        client = [client withPathRoot:cpr];
       //
       // call to get folders etc...

 

Or is there  a simpler way i am overlooking? 

Highlighted

Re: adding team functionality to an existing dropbox app

Dropboxer
Dropboxer

Yes, that's right. That would use the user's folder, if they're not on a team with a team space, or the team space folder, if they are on a team with the team space. Also, note you can use initWithRoot if you do intend to access the root and want verification mentioned under the "Root" part of the "Dropbox-API-Path-Root Header Modes" section of the Namespace Guide (whereas initWithNamespaceId can be used for any particular namespace the user has access to).

View solution in original post

Polls
Do you know how to organize your files and folders?
<b>We have created a guide on folder best practice, so you can get organized now <a href="https://www.dropboxforum.com/t5/Business-Tips-tricks/Folder-structure-best-practice/m-p/428456#M39"><u>check it out here</u></a>.</b>

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?