We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
JoffreyActeis
2 years agoNew member | Level 2
400 Client Error: Bad Request for url: https://api.dropboxapi.com/2/files/create_folder_v2
Hello, I can't get my code Python to work. Can you help me? import dropbox import requests # Remplacez ceci par votre propre jeton d'accès OAuth 2 ACCESS_TOKEN = 'Mytoken' # Remplacez ce...
Greg-DB
2 years agoDropbox Staff
When you get a 400 error like this, be sure to print out the response body, as it should contain a more specific error message indicating what the issue is. If you need help with that error, please print it out and share it.
Also though, I notice that you're importing and using both 'dropbox' and 'requests', and you're using 'requests' to call the /2/files/create_folder_v2 endpoint yourself. We recommend using the official SDKs, such as 'dropbox' whenever possible though, and it implements native methods for the endpoints for you, so you don't need to use a network client directly, like you are with 'requests'. Specifically, instead of calling /2/files/create_folder_v2 with 'requests', you can use the provided files_create_folder_v2 method on the Dropbox class.
I notice you are using the 'Dropbox-API-Select-User' header; that's also available natively on DropboxTeam via the as_user method, which would then give you a Dropbox object which you can then use to call files_create_folder_v2, etc.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 4 hours agoIf 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!