Skip to main content

Hi,

I’m trying to use the python API to download files from a collaborator shared folder. I’m using a free developer account. I made an app and it was authorized (by myself). It was working fine in March 2024 and stopped working when I tried today (Sept 13 2024).

```

auth = CCGAuth(client_id='xxx',client_secret='xxx',user='xxx')
client = Client(auth)
user =  client.user().get()

"POST https://api.box.com/oauth2/token" 400 77{'date': 'Fri, 13 Sep 2024 17:49:32 GMT', 'content-type': 'application/json', 'strict-transport-security': 'max-age=31536000', 'set-cookie': 'box_visitor_id=66e478e2429fb8.44475236; expires=Sat, 13-Sep-2025 17:49:32 GMT; Max-Age=31536000; path=/; domain=.box.com; secure; SameSite=None, bv=PARTNERS-28114; expires=Fri, 20-Sep-2024 17:49:32 GMT; Max-Age=604800; path=/; domain=.app.box.com; secure, cn=33; expires=Sat, 13-Sep-2025 17:49:32 GMT; Max-Age=31536000; path=/; domain=.app.box.com; secure, site_preference=desktop; path=/; domain=.box.com; secure', 'cache-control': 'no-store', 'via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000', 'Transfer-Encoding': 'chunked'}{'error': 'invalid_grant', 'error_description': 'Grant credentials are invalid'}

```

The client id and client secret are up to date, I also tried to reauthorize the app, although I didn’t make any modification. I’m stuck here.

 

I understand I can use OAuth2 and developer token, and it does work with the same client id and client secret, but the token only last 60 min and I need much more time to download multiple files. 
Could you help? Thank you.

Hi @user211 👋 Welcome to our community. Thanks for bringing this up.

There’s a related topic regarding the error you encountered and also described in the Common Errors section of our documentation. Have you tried generating user access tokens then re-authorizing the app in your Admin Console?

Changing the subject type and ID would also help.

In the event that you still encountered an error, please reach out to our Product Support by submitting a ticket here.

Looking forward to have this sorted out! 🤗


Hi @user211 👋 Welcome to our community. Thanks for bringing this up.

There’s a related topic regarding the error you encountered and also described in the Common Errors section of our documentation. Have you tried generating user access tokens then re-authorizing the app in your Admin Console?

Changing the subject type and ID would also help.

In the event that you still encountered an error, please reach out to our Product Support by submitting a ticket here.

Looking forward to have this sorted out! 🤗

Thanks for the hint. 

After changing App access level to “App + Enterprise Access” and check Advanced Features → generate user access tokens, and re authorization, the code worked and I was able to download.

But it is still somewhat strange that it works six months ago and it stopped working all of a sudden without any changes. 

 


Hi @user211 Awesome! Glad to know that the code worked after necessary changes and you’re able to download now. 😊

I’ve raised it internally as it turns out that we recently had few cases with the same error. This is being investigated to prevent further issues in the future. I appreciate your continued patience!

Have a good one! 🌻


Reply