Skip to main content
Box Employee
May 23, 2025 9:26 AM UTC
Question

Invalid_grant - Grant credentials are invalid

Hi, I have created a "Custom APP" with "Server Authentication (Client Credentials Grant)". While using the SDK, I'm passing my client ID, client secret, and user id. Here is the code.

BoxCCGAPIConnection api = BoxCCGAPIConnection.userConnection(
"1z7s4rcl4gpjudynikjvrupgj9fmttgp",
"Client Secret",
"User ID"
);
BoxFolder rootFolder = BoxFolder.getRootFolder(api);
for (BoxItem.Info itemInfo : rootFolder) {
System.out.format("%s\n", itemInfo.getName());

Getting the following error while executing the code.
Exception in thread "main" com.box.sdk.BoxAPIResponseException: The API returned an error code [400] invalid_grant - Grant credentials are invalid

    11 replies

    Box Employee
    May 23, 2025 9:26 AM UTC

    Hi,

    Was your Box application recently created on a free developer account?

    We had to temporarily disable some features on the free developer accounts.

    It should be back soon.

    Best regard

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    Thanks, 5640054956051.

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    Hello 5640054956051

    Does this mean that we are unable to test any API connections when we're on free developer accounts?

    I am getting the same issue with box_subject_type = user and box_subject_id = {userId}

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

    Are there any updates on this?

    Thanks

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    Hi Shaniah,

    Not at all.

    It means you have to temporarily use OAuth2.0 or developer tokens.

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    5640054956051, do you know when will this be back?  I have a partner system using Box to drop files and I can't get to it using Box SDK.

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    Hi Vince,

    You should be able to temporarily use OAuth 2.0.

    Best regards 

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    In another word, I can only use CCG if I have a paid account, 5640054956051?

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    Hi Vince,

    It depends, see this thread for details.

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    This is a legit business purpose and I can't provide details on the public forum.  Is there a technical support system I can submit a ticket to?  I can't use OAuth2 for a backend process.  I can pay for the account, but I need to know if that will resolve the CCG blocking.  Thanks, 5640054956051

    Translate
    Box Employee
    May 23, 2025 9:26 AM UTC

    5640054956051, I upgraded mine to a paid account and the restrictions are still there.  I can't use CCG.  How do I contact technical support on my paid account?  I do not see the menu or where I can contact.  When I chose Contact Support, it brought me to Community Forum?!

    Translate