Solved

Rest API Logout method

  • 3 November 2023
  • 4 replies
  • 179 views

Userlevel 3
Badge

Hi,

I use the Resource Owner Password Credentials Flow to call the Acumatica API.as the 1st step I generate a token and using this token I call the API.

My scope is api.

I need to know after calling the api should I log out or close the session.

icon

Best answer by RohitRattan88 6 November 2023, 16:06

View original

4 replies

Userlevel 7
Badge +12

Hi you should be logging out with the cookie as this is the session otherwise you risk hitting the number of open sessions limit.

This post should help

 

Userlevel 7
Badge +4

@jeewanishalika20 

From the documentation in I320 

https://openuni.acumatica.com/courses/integration/i320-advanced-data-retrieval-with-rest-api/

If you have granted only the api scope to the application, the access token of the application expires in one hour and the session that was opened for this access token is closed automatically. However, if the application has been granted only the api scope, we recommend that you call the sign-out method after you have finished your work with Acumatica ERP, because the Acumatica ERP license includes a limit for the number of API users. If you have not signed out, you may have issues with subsequent authorization requests or sign-ins through the API. For details about how to deal with the issues related to the limit for the number of API users during the authorization requests,

Userlevel 3
Badge

Hi @RohitRattan88 ,

Is it enough for use auth/logout api to signout.

 

 

Userlevel 7
Badge +4

@jeewanishalika20 

Logout API call should be enough but make sure to pass session cookie as described in documentation:

Logging Out from Acumatica ERP

To prevent issues with licenses that limit the number of concurrent user sessions, the client application should directly call the logout method of the Acumatica ERP web services API when the application finishes its work with Acumatica ERP. The client application does this by using the POST method, the ASP.NET_SessionId cookie with the value that corresponds to the session, and the following URL.

https://<Acumatica ERP instance URL>/entity/auth/logout

In this address, <Acumatica ERP instance URL> is the URL of the Acumatica ERP instance to which the client application is going to connect.

Ref: https://help.acumatica.com/(W(248))/Help?ScreenId=ShowWiki&pageid=2930d2f7-e081-4d0e-8879-93907ce82607

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