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
bszt123
7 months agoHelpful | Level 5
Dropbox API error with 500
Greetings, I am encountering the following error while calling the Dropbox API: InternalServerError('6c7329b49922471380831b2b3f2fb49c', 500, '{"error": "The server has either erred or is inca...
- 6 months ago
Yes, that error indicates an issue with the value passed to as_user. The as_user method requires a team member ID, not an email address. You can get team member IDs from team_members_get_info_v2 or team_members_list_v2 and team_members_list_continue_v2, for example.
bszt123
Helpful | Level 5
Thank you for the response.
Here is the code we are currently using to call the API:
self.dbx = dropbox.DropboxTeam(self.app_token).as_user(some_id) root_namespace_id = self.dbx.users_get_current_account().root_info.root_namespace_id result = self.dbx.files_list_folder(path)
When calling self.dbx.users_get_current_account(), we encounter the following error:
dropbox.exceptions.InternalServerError: InternalServerError('5fe3180d6a9a4c64a0e319c78f7693a7', 500, '')
Could you explain this issue? And if possible, please provide the correct method to call this.
Greg-DB
6 months agoDropbox Staff
Is that all of the actual relevant code you're running? I notice you don't seem to be using the 'root_namespace_id' value anywhere. Are you calling with_path_root? Please share any other relevant pieces of code.
Also, please share several more (5-10) current error outputs like this so we can look into what you're currently running in to. (Just one request ID like this unfortunately isn't always sufficient.)
- bszt1236 months agoHelpful | Level 5
Sorry, I think I posted the old version of the code.
Here is the latest version of the code we are currently using:
self.dbx = dropbox.DropboxTeam(self.app_token).as_user(some_id)
root_namespace_id = self.dbx.users_get_current_account().root_info.root_namespace_id
self.dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id)).files_list_folder(path)
And Here's some error outputs we encountered :
InternalServerError('6bc6a197ce6243f3b7a405839b333601', 500, '')InternalServerError('fd33a6a27af3434b960e78daea94ac71', 500, '')
InternalServerError('c5665dbc98c44f8bad19562e4c1c49ca', 500, '')
InternalServerError('e31a5e86e64d4193801bb3d41e070740', 500, '')
InternalServerError('ac9967c17ab2485aa0d9e0f65f9bf136', 500, '')
InternalServerError('614843bd85c24b98abe66c76bfa04be0', 500, '')
InternalServerError('c1e440b9e8e244acb9c61a0d53195acc', 500, '')
Thank you for your support!
- Greg-DB6 months agoDropbox Staff
Thanks, that's helpful. It looks like you're actually hitting a different issue now. It appears you're sending an improperly formatted Authorization header value. Please remove any leading or trailing whitespace from your access token string (self.app_token in this code snippet) and try again.
- bszt1236 months agoHelpful | Level 5
You're right! there's some whitespace in our token string. thank you for your help.
After removing the whitespace, we've encounter an error below:
('feefc7a078c647338e0c5381bc129ff8', 400, 'Error in call to API function "users/get_current_account": Invalid select user id format')
('61bd222a697c4c4586ec7954d87ae3bb', 400, 'Error in call to API function "users/get_current_account": Invalid select user id format')
('e809c790be5a4994a0612d593f8b1be5', 400, 'Error in call to API function "users/get_current_account": Invalid select user id format')
('89e8b8eb91904084824fb114ae56eaa3', 400, 'Error in call to API function "users/get_current_account": Invalid select user id format')
Here is the latest version of the code we are currently using:
some_id = 'example@pping.kr'
self.dbx = dropbox.DropboxTeam(self.app_token).as_user(some_id)
root_namespace_id = self.dbx.users_get_current_account().root_info.root_namespace_id
self.dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id)).files_list_folder(path)Is there a mistake while using user_id?
- Greg-DB6 months agoDropbox Staff
Yes, that error indicates an issue with the value passed to as_user. The as_user method requires a team member ID, not an email address. You can get team member IDs from team_members_get_info_v2 or team_members_list_v2 and team_members_list_continue_v2, for example.
- bszt1236 months agoHelpful | Level 5
It works. Thank you!
Yet we have another issue with the refresh token, but we will ask about this in another thread next time.
Thank you again.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 2 years 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!