Created
May 30, 2012 00:55
-
-
Save seanrose/2831909 to your computer and use it in GitHub Desktop.
Making Your First Box API Call (Python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
#Set our API Key and the user's auth token (see http://developers.box.com/get-started/#authenticating) | |
api_key = YOUR_API_KEY | |
auth_token = YOUR_AUTH_TOKEN | |
auth_header = {'Authorization': | |
'BoxAuth api_key=%s&auth_token=%s' % (api_key, auth_token)} | |
#We're going to pull the contents of our account's root folder whose ID is '0' | |
api_url = 'https://api.box.com/2.0/' | |
resource = 'folders/0' | |
r = requests.get(url=api_url+resource, headers=auth_header) | |
print r.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment