Skip to main content
Solved

Client Credentials Grant User ID Access_token failed

  • September 22, 2023
  • 9 replies
  • 300 views

I would like to obtain Access_Token through ‘Client Credentials Grant’.


I created a New App through the My Apps menu.


Administrator approval was obtained through the Authorization tab.



When I request authentication as follows, an error message appears.


https://api.box.com/oauth2/token

grant_type: client_credentials

client_id: xd~~

client_secret: Tm~~

box_subject_type: user

box_subject_id: 28~~


response)

{

“error”: “invalid_grant”,

“error_description”: “Grant credentials are invalid”

}


I requested the API through ‘Postman’.


Help me please~

Thanks.

Best answer by converselabels

Hello,



I was able to get the Access_token after selecting the above option and authenticating to the administrator again.


Thanks.

View original
Did this topic help you find an answer to your question?

9 replies

smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 22, 2023

Hello 👋,


This is probably because of the issues described in the common errors section of our documentation. Depending on what access levels you set up for your application change the parameters you need to send in with the request.


Thanks,

Alex, Box Developer Advocate 🥑


  • Author
  • Participating Frequently
  • 6 replies
  • September 23, 2023

Hello~

In the above parameters, applying for access_token with enterprise ID was successful, but applying with user ID failed.

Is there anything else I need to do in the Custom App?

Thanks.


  • Author
  • Participating Frequently
  • 6 replies
  • September 23, 2023


Is this option related to requesting Access_Token for User ID?


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 25, 2023

Yes, you will need to check that box labeled - generate user access tokens… make sure to reauthorize after you do this.


smartoneinok Box
Forum|alt.badge.img
  • Senior Developer Advocate
  • 181 replies
  • September 25, 2023

Correction - you just need the one box for generate user access tokens…not both


  • Author
  • Participating Frequently
  • 6 replies
  • Answer
  • September 26, 2023

Hello,



I was able to get the Access_token after selecting the above option and authenticating to the administrator again.


Thanks.


  • 2 replies
  • October 3, 2023

Hi, I have created an app and my app is authorized but on making api request I am not able to retrieve the files in the box, it is giving only the app details.

I’m passing subject type as enterprise and subject id and in the Application scope I have selected “Make API calls using the as-user header”, with this Iam getting access token but this token is giving only the app details not the folder/files details. Can you please help me in retrieving the box folders/files. Thanks


  • Author
  • Participating Frequently
  • 6 replies
  • October 4, 2023

Try requesting the access_token with the User ID, not the enterprise ID.


  • 2 replies
  • October 4, 2023

I am able to retrieve the files using user id. Thanks for the help!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings