Skip to main content
{
'client_id': "xxxxxxx@company",
'client_secret': "xxxxxxxxxx",
'grant_type': 'client_credentials',
# 'grant_type': 'password',
'scope': "api",
'username': 'xxxx',
'password': 'xxxx',
}

This is the body I am sending, but I am getting `{'error': 'unauthorized_client'}` what am I missing?

Secondly, the documentation says the grant_type must set to `password`, but if I do that, I get `invalid_grant`

You seem to be attempting to connect application using the Access Token Request Endpoint. 

Is your application set up on the SM.30.30.10 Connected Applications Screen within Acumatica? 

Also your request body seems to be missing the redirect URI for Acumatica to send requests to your application.

I think this is the documentation you are referring to in your question

https://help-2022r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=ff780860-09c2-46c9-bdd7-c6c3b1fc442c


You seem to be attempting to connect application using the Access Token Request Endpoint. 

Is your application set up on the SM.30.30.10 Connected Applications Screen within Acumatica? 

Also your request body seems to be missing the redirect URI for Acumatica to send requests to your application.

I think this is the documentation you are referring to in your question

https://help-2022r1.acumatica.com/Help?ScreenId=ShowWiki&pageid=ff780860-09c2-46c9-bdd7-c6c3b1fc442c

Thanks for the reply, unfortunately the unauthorized error was due to `'grant_type': 'client_credentials'`, which is not accepted in Acumentica, The correct grant_type was actually `password`. 

When I had `grant_type` being `password` and got the `invalid grant` error, it was due to the admin not setup the API access correctly.


Reply