Forum Discussion

christopher-fam's avatar
christopher-fam
Explorer | Level 3
5 years ago

Creating Team Folder via Python SDK

I'm trying to create team folders on a business account through the python SDK. 

 

when I run the following code:

 

 

dbx = dropbox.DropboxTeam(access_token).as_admin(team_member_id)
dbx.files_create_folder_v2('/test_folder')

 

I get an error stating:

 

CreateFolderError('path', WriteError('no_write_permission', None)))

I have given my app all the write permissions it needs.

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The /2/files/create_folder_v2 endpoint that the files_create_folder_v2 method uses only supports the Dropbox-API-Select-Admin
    "Team Admin" mode, meaning: 

    The endpoint can access content of team folders but not team member's private files.

    Since you're using "as_admin", that's setting the "Dropbox-API-Select-Admin" header, but by default API calls operate in the member's own private folder.

     

    So, if you did intend to create the folder inside the member's own private folder, you should use "as_user", instead of "as_admin".

     

    Alternatively, if you meant to create the folder in the "team space", you should also use "with_path_root" to root the call in the team space. Please refer to the Team Files Guide for information on using that if so.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 19 hours ago
351 Following

If 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!