Skip to main content
Question

can't able to open folder using access token

  • May 22, 2025
  • 3 replies
  • 72 views

Forum|alt.badge.img

Hi Team,
i'm generating access token using 'Request access token' api and also getting the access token .
Biut when i'm using this access token to another api , it is returning error.
{
    "type": "error",
    "status": 404,
    "code": "not_found",
    "context_info": {
        "errors": [
            {
                "reason": "invalid_parameter",
                "name": "parent",
                "message": "Invalid value 'd_164615683363'. 'parent' with value 'd_164615683363' not found"
            }
        ]
    },
    "help_url": "http://developers.box.com/docs/#errors",
    "message": "Not Found",
    "request_id": "esh2ech2yxeqeikp"
}

How can this be solved 

3 replies

Forum|alt.badge.img

HI Akanksha

Most likely you are getting a token for a user that does not have access to the folder in question. An access token always belongs to a user and if you have used the API you probably have a server side app like a JWT or Client Credentials Grant app. When you generate a token for these you will get a token for the service account or automation user generated with the app. You can check this by running this API and check the details of the user returned. https://developer.box.com/reference/get-users-me/

If the folder is owned by your 'standard' box user you can either generate a token for that user, use the 'as-user' header or collaborate the automation user onto the folder. You can see the loginID of the automation user in the general settings of your app in the developer console.. It will look like 'AutomationUser_123456_abcdef@boxdevedition.com 

Hope this helps

Peter Christensen, Platform Solutions Engineer, Box


Forum|alt.badge.img

Hi Peter ,
can you let me know how can we generate access token using client credentials grant app ? 
i tried using this approach. but how can we get auth code to pass in the header?

 


Forum|alt.badge.img

Hi

With client credentials grant you don't need the auth code as it is a server side authentication.

See this guide: https://developer.box.com/guides/authentication/client-credentials/ which has some examples

Rgds,

Peter