box / box-windows-sdk-v2

Windows SDK for v2 of the Box API. The SDK is built upon .NET Framework 4.5

Home Page:https://developer.box.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CreateEnterpriseUserAsync throwing access_denied_insufficient_permissions - Access denied - insufficient permission

nthandu opened this issue · comments

Description of the Issue

Create the app user throwing access denied insufficient permission error when running the sample Box.V2.Samples.Core.AppUser.Create
I have created the custom app including the manage users scope and authorised the app. I have the co-admin permission and I have authorised the app.

Steps to Reproduce

1). Clone Box.V2.Samples.Core.AppUser.Create repo
2). Replace the client secrets json file
3. Run the application and it will fail at line invoking create enterprise user.

Expected Behavior

Error Message, Including Stack Trace

Unhandled exception. Box.V2.Exceptions.BoxException: The API returned an error [Forbidden | a9f0183b757d] access_denied_insufficient_permissions - Access denied - insufficient permission
at Box.V2.Extensions.BoxResponseExtensions.ParseResults[T](IBoxResponse1 response, IBoxConverter converter) at Box.V2.Managers.BoxResourceManager.ToResponseAsync[T](IBoxRequest request, Boolean queueRequest) at Box.V2.Managers.BoxUsersManager.CreateEnterpriseUserAsync(BoxUserRequest userRequest, IEnumerable1 fields)
at BoxPlayground.Program.ExecuteMainAsync() in $\BoxPlayground\Program.cs:line 50
at BoxPlayground.Program.Main(String[] args) in $\BoxPlayground\Program.cs:line 17
at BoxPlayground.Program.

(String[] args)

Screenshots

Versions Used

.Net SDK:
Windows:

@PJSimon @sujaygarlanka
Sorry to bother you.
Any help would be appreciated on the above. Thanks

Hi @nthandu
To create an enterprise user you need "manage users" scope, Enteprise access and your applications must be authorized by an admin. If you are still encountering this issue after following those steps, please fill a ticket to Box User services - see https://support.box.com/hc/en-us/articles/360043693434-API-Content-API-403-access-denied-insufficient-permissions-Errors as the problem could lie elsewhere and it is out of scope of the sdk.

Thanks,
@mwwoda

ezoic increase your site revenue