API calls with JWT hanging
AnsweredI am using Nuget packages for Box API integration from my .net application. I am succesfully getting access token but API calls to create users, folder are just hanging and not working. I am just following the documentation. Not sure what am I missing.
-
Sorry, here's the error message that I am getting when trying to create an app_user
A first chance exception of type 'Box.V2.Exceptions.BoxException' occurred in Box.V2.dll
Additional information: Bearer realm="Service", error="insufficient_scope", error_description="The request requires higher privileges than provided by the access token."
-
Thanks for the response. I am making progress.
Earlier I gave User Access to "App Users" as per documentation and now selected "All Users". I also selected all options for scopes and advanced features.
I reauthorized the app in the admin console.
I am now able to create an app user but getting 403 for creating a folder withe the following message.
A first chance exception of type 'Box.V2.Exceptions.BoxException' occurred in Box.V2.dll
Additional information: {"type":"error","status":403,"code":"access_denied_insufficient_permissions","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Access denied - insufficient permission","request_id":"removed for privacy2583f38e2cb0f2"}
-
User access token.
Here's my code.
//using an app user that I created already
var userToken = session.UserToken(app_user_id);
var userClient = session.UserClient(userToken, app_user_id);
var newFolder = await CreateAFolder(userClient);
private static Task<BoxFolder> CreateAFolder(BoxClient userClient)
{
var folderRequest = new BoxFolderRequest
{
Description = "Test folder",
Name = "My Test",
Parent = new BoxFolderRequest { Id = "0" }
};
return userClient.FoldersManager.CreateAsync(folderRequest);
}
-
I need a little bit more help on this. I have tried to use the APIs as-user and got insufficient permissions error. I even setup the user as an admin in admin console and received the same error.
When I used the enterprise access token, I was able to create the folder but it is not showing up in our folder structure. Is the folder created in a different environment? Not sure what am I missing.
-
The App a.k.a Service Account
output:
folder owner: KenJWT3
file owner name: KenJWT3
Please sign in to leave a comment.
Comments
10 comments