Open marinabuezo opened 1 week ago
Developer tokens are usually short-lived. It is possible that yours has expired before the call was made. You can try making the same call with cURL to make sure it's not a problem with the SDK itself - https://developer.box.com/reference/get-folders-id/
curl -i -X GET "https://api.box.com/2.0/folders/0" \
-H "authorization: Bearer <ACCESS_TOKEN>"
If problem still persist I recommend reaching out to our forums
Description of the Issue
I am trying to use https://github.com/box/box-python-sdk-gen?tab=readme-ov-file#installing to connect to box so that I can download and upload files. I have tried getting a Developer Token from the Configuration page and inserting into code. I then try to run the code but get this issue: Message: Developer token has expired. Please provide a new one.
Steps to Reproduce
def main(token: str): auth: BoxDeveloperTokenAuth = BoxDeveloperTokenAuth(token=token) client: BoxClient = BoxClient(auth=auth) for item in client.folders.get_folder_items('0').entries: print(item.name)
if name == 'main': main('INSERT YOUR DEVELOPER TOKEN HERE')
Expected Behavior
I expected it to be able to connect to my box
Error Message, Including Stack Trace
Screenshots
attached
Versions Used
Python: Python 3.11.8