Error: SDK v2 .NET Client Grant Credentials Invalid request box_subject_id box_subject_type

Hello,

I’m trying to authenticate with Client Grant Credentials using the .NET SDK V2, version 5.7.1.

The app has App Access Leval: App + Enterprise Access;
All Application Scopes selected;
All Advanced Features selected;
App authorized by admin.

My code:

var boxConfig = new BoxConfigBuilder(_Config.ClientId, _Config.GetClientSecretKey())
							.SetEnterpriseId(_Config.EnterpriseId)
							.Build();
var boxCCG = new BoxCCGAuth(boxConfig);
client = (BoxClient)boxCCG.AdminClient();
BoxCollection<BoxFileVersion> fileVersions = await client.FilesManager.ViewVersionsAsync(file_id, offset: offset, limit: limit);

I get the following error:

Box.V2.Exceptions.BoxAPIException: ‘The API returned an error [BadRequest] invalid_request - “box_subject_id” cannot be used without a “box_subject_type” for the “client_credentials” grant type’

How can i solve this?
Thank you

The error message is misleading. The problem was wrong Enterprise ID.
The real Enterprise ID is only displayed to the admin user.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.