Forum Discussion

schek's avatar
schek
Explorer | Level 3
6 years ago
Solved

API File upload to a member's shared folder

I am trying to upload a report file using API to business team member's shared folder.

What is the best way to do this?

Does using /2/files/upload endpoint requires, the shared folder I am uploading the file to, be shared to the account executing the API call?

  • Using the /2/files/upload endpoints (or /2/files/upload_session/* endpoints, for larger files) is the correct way to upload files.

    When you do so, you'll specify the 'path' for where to upload the file. This would be the path in the connected account, based on the access token used for the API call. The path does not have to be inside a shared folder, but it can be. You can specify the path to be inside a shared folder, or not, depending on the use case, and/or user input, etc. 

    Note that if the access token is for a particular, say, User A, but you want to upload the file to another user, say, User B, you would need to either:

    • upload the file to a shared folder in User A's account that User B is also a member of
    • get and use an access token for User B instead

    Note that one exception is if you are using a "Dropbox Business API app" with the "team member file access" permission, in which case the access token enables access to the entire team and you have the ability to perform operations on any team member.

    I recommend reviewing the Namespace Guide and Content Access Guide for more information.

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

    Using the /2/files/upload endpoints (or /2/files/upload_session/* endpoints, for larger files) is the correct way to upload files.

    When you do so, you'll specify the 'path' for where to upload the file. This would be the path in the connected account, based on the access token used for the API call. The path does not have to be inside a shared folder, but it can be. You can specify the path to be inside a shared folder, or not, depending on the use case, and/or user input, etc. 

    Note that if the access token is for a particular, say, User A, but you want to upload the file to another user, say, User B, you would need to either:

    • upload the file to a shared folder in User A's account that User B is also a member of
    • get and use an access token for User B instead

    Note that one exception is if you are using a "Dropbox Business API app" with the "team member file access" permission, in which case the access token enables access to the entire team and you have the ability to perform operations on any team member.

    I recommend reviewing the Namespace Guide and Content Access Guide for more information.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,940 PostsLatest Activity: 24 hours ago
350 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!