- Tested with Python 2.7.6 and Python 3.3.2 on Mac OS X 10.9
- Bitcasa API v1
- requests v1.x
- rauth
See requirements.txt
$ pip install -r requirements.txt
First, register your app in Bitcasa API Console
$ export BITCASA_CLIENT_ID="<your_client_id>"
$ export BITCASA_CLIENT_SECRET="<your_client_secret>"
$ python get_access_token.py
Please go to https://developer.api.bitcasa.com/v1/oauth2/authenticate?client_id=<client_id> and authorize access.
Enter the full callback URL: https://developer.api.bitcasa.com/v1/oauth2/accessing?authorization_code=<authorization_code>#/authenticate?client_id=<client_id>
access_token: <access_token>
from bitcasa import BitcasaClient
client_id = '<your_client_id>'
client_secret = '<your_client_secret>'
access_token = '<your_access_token>'
bitcasa = BitcasaClient(client_id, client_secret, access_token)
r = bitcasa.get('folders/', params={'depth': 1})
print r.json()
$ export BITCASA_CLIENT_ID="<your_client_id>"
$ export BITCASA_CLIENT_SECRET="<your_client_secret>"
$ export BITCASA_ACCESS_TOKEN="<your_access_token>"
$ python example.py
(list bitcasa folders)
BitcasaClient built on rauth's OAuth2Session. OAuth2Session built on requests's Session.
So, You can use same API of requests.