Skip to main content
Solved

Rest API Logout method


Forum|alt.badge.img

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.

Best answer by RohitRattan88

@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

View original
Did this topic help you find an answer to your question?

4 replies

dcomerford
Captain I
Forum|alt.badge.img+15
  • Captain I
  • 622 replies
  • November 3, 2023

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

 


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 252 replies
  • November 3, 2023

@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,


Forum|alt.badge.img

Hi @RohitRattan88 ,

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

 

 


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 252 replies
  • Answer
  • November 6, 2023

@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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings