Skip to main content
Question

API error - Grant credentials are invalid

  • May 23, 2025
  • 1 reply
  • 49 views

Forum|alt.badge.img

Hi,

I am getting this error when when I am trying to generate access token using the credentials.

{"error":"invalid_grant","error_description":"Grant credentials are invalid"} 

Client id:n3zymfu33bllosrhesubgotmdk7wei27

box_subject_id: 25900613592

box_subject_type: user

grant_type: client_credentials

App Access Level is set to App Access Only.

 

Can anyone please look into this?

Thanks,

LG

1 reply

Forum|alt.badge.img

I got the same "invalid_grant" error.  However, using "enterprise" type as below:

curl -i -X POST "https://api.box.com/oauth2/token" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "client_id=***" \
     -d "client_secret=***" \
     -d "grant_type=client_credentials" \
     -d "box_subject_type=enterprise"  \
     -d "box_subject_id=account_enterprise_id_here"

I did get back a token:

{"access_token":"***","expires_in":3708,"restricted_to":[],"token_type":"bearer"}