Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The current Python SDK does not appear to support the Business API; are there any good resources for app integration with the Dropbox for Business API?
That's correct, the Python SDK isn't built for the Dropbox for Business API (only the Core API), but I'll be sure to pass this along as feedback. Right now, the Dropbox for Business API is just meant to be consumed using an HTTP client, but the Python SDK is open source, so you can modify it if/as desired.
Here's a little sample to help you get going. This code reads all the events for the team via the event log. (It uses the Python requests library.)
params = {}
while True:
response = requests.post('https://api.dropbox.com/1/team/log/get_events', headers={
'Authorization': 'Bearer %s' % access_token,
'Content-Type': 'application/json'
}, data=json.dumps(params)).json()
for event in response['events']:
print event # (or do something more useful)
params['cursor'] = response['cursor']
if not response['has_more']:
print 'Sleeping...'
time.sleep(10)
Thanks for the code snippet.
To clarify, is the access token here the same as the access token generated either on the app console or through passing in the app key/app secret to the dropbox client, then authorizing the given url? I have not been been able to make any specific dropbox for business API calls using that token (the token works perfectly for Core API calls); for example, the request below returns a 403 'App does not have access to this endpoint'. The app is set to have 'team member file access'.
Yes, it's the access token you got from the app console or by authorizing an actual user (a Dropbox for Business team admin, in this case).
To access this endpoint, though, you do need "team auditing" permission. See https://www.dropbox.com/developers/business/docs#log-get-events.
Thanks, Steve. It looked to me like team auditing permission was bundled with file access; the description next to that permission level reads: "Team information and auditing, plus the ability to perform any action as any team member". Is there some other step needed to get access to the right permissions to access the business api endpoints?
Oh, sorry! You're right.
My only guess is that you're not using an access token from the right app? Double check that the app permission is what you think it is and that you generated a token for the right app.
Thanks so much for your help, Steve! I'm not sure what the problem was, I deleted the app & reset it up and everything seems to be working fine. Must've done something odd when setting up the app the first time around. Thanks again for your help troubleshooting.
Hi there!
If you need more help you can view your support options (expected response time for a 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!