Sign Out from the Service
Each time your application finishes working with the MYOB Acumatica contract-based REST service, you have to sign out from MYOB Acumatica. To sign out from MYOB Acumatica, you access the needed URL address with the POST HTTP method. See the
following sections for details on the request and the response.
HTTP Method and URL
When you need to sign out from MYOB Acumatica, you use the POST HTTP method and the following URL.
POST http://<MYOB Acumatica instance URL>/entity/auth/logout
You replace <MYOB Acumatica instance URL> with the URL of your MYOB Acumatica instance.
For example, suppose that you want to sign out from a local MYOB Acumatica instance with the name AcumaticaDB. You should use the following URL: http://localhost/AcumaticaDB/entity/auth/logout.
Parameters
You do not need to use parameters when you sign out from MYOB Acumatica.
Request Headers
| Header | Description |
|---|---|
| Cookie |
Specifies the cookies that you have received during the sing-in to MYOB Acumatica with the login method. For details on this method, see Sign In to the Service. You must use the Cookie header in any of the following cases:
|
| Authorization |
Contains the access token that the application has received during the authorization with OAuth 2.0 or OIDC. You must pass the Authorization header only if you are using the OAuth 2.0 or OIDC authorization. |
Response Status Codes
The following table lists the HTTP status codes that the system returns for a sign-out request.
| Code | Description |
|---|---|
| 204 | The request has been completed successfully. |
| 400 |
The data specified in the request is invalid. |
| 429 |
The number of requests has exceeded the limit imposed by the license (see License Restrictions for API Users). |
| 500 |
An internal server error has occurred. |
Example
The following request shows an example of a sign-out from MYOB Acumatica through the REST API.
<MYOB Acumatica host> is the URL of the MYOB Acumatica
host (such as https://my.acumatica.com). You need to use the instance name in the
URL of the request (such as https://my.acumatica.com/MyInstance) if the instance
is not installed in the root of the website.POST /entity/auth/logout HTTP/1.1
Host: [<MYOB Acumatica host>]
Usage Notes
For each attempt to sign in to MYOB Acumatica, you must implement the signing out from the service after you finish your work with MYOB Acumatica to close the session. If the session is not closed, you may have issues with subsequent sign-ins to MYOB Acumatica through the REST API.
If your applications failed to sign out from MYOB Acumatica and the maximum number of concurrent sessions allowed by the license is reached, there is no way to forcibly terminate all sessions of the API users. Instead, a session is automatically closed after a 10-minute timeout.
