log into box python api
I'm attempting to log onto box using the python boxsdk but have had no luck even accessing my directory. The code and error are below, note the clientID, clientSecret, and userid have been redacted.
Ultimately my goal is to schedule uploads into box with python, so if you can help with that too that would be a great help. I did take a good look at the boxsdk python code, which got me to this point. I have no interest in the desktop box software.
-----Code-----
from boxsdk import OAuth2, Client
clientID = "dfdsf42532532"
clientSecret = "***number removed for privacy***"
uid = '***number removed for privacy***3'
oauth = OAuth2(
client_id=clientID,
client_secret=clientSecret,
)
me = client.user(user_id=uid).get()
-----Message-----
File "C:\python-3.6.5.amd64\lib\site-packages\boxsdk\auth\oauth2.py", line 288, in send_token_request
raise BoxOAuthException(network_response.status_code, network_response.content, url, 'POST')
BoxOAuthException:
Message: b'{"error":"unauthorized_client","error_description":"The grant type is unauthorized for this client_id"}'
Status: 400
URL: https://api.box.com/oauth2/token
Method: POST
Post is closed for comments.
Comments
1 comment