Solved

Rest API

  • 16 December 2022
  • 7 replies
  • 1688 views

Userlevel 2
Badge

I am trying use the Login to Acumatica Rest API with Postman. 

​​According to the documentation I have found in the web, I should be using http://MyCompany.acumatica.com/entity/auth/login as URL

 

The body as detailed below:

{
"name":"johnd",
"password":"johndpassword",
"tenant":"mytenant"
}

 

I get an error in Postman as detailed below:

{"message":"An error has occurred.","exceptionMessage":"Error: Invalid credentials. Please try again.","exceptionType":"PX.Data.PXException","stackTrace":" at PX.Data.PXLogin.LoginUserImpl(HttpContext httpContext, String userName, String password)\r\n

What am I doing wrong?

icon

Best answer by Kulvir Kaila 16 December 2022, 20:26

View original

7 replies

Userlevel 5
Badge +1

Hi @RafaDiazBAI 

The request looks fine. Are you able to login using these credentials in the browser /UI?

Userlevel 2
Badge

Yes, I am able to login with the same credentials in the browser/UI

Userlevel 4
Badge +2

Your url looks correct but you might need to specify the branch in your JSON payload.  Also noticed you are using the keyword tenant instead of company.

{

"name" : "{{name}}",

"password" : "{{password}}",

"company" : "{{company}}",

"branch" : "{{branch}}"

}

 

Userlevel 2
Badge

Thanks! Issue solved.

 

 

@RafaDiazBAI can you please share the documentation you have mentioned above? 
Thanks.

Userlevel 7
Badge +4

@osamaaslam49  you could search it on help.acumatica.com

Acumatica

Userlevel 2
Badge

Yes, the documentation if found at:

https://help-2022r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=0322492a-de9b-4443-b256-923c48aff31d

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved