All Classes Pages
LogoutPage Class Reference

WSAPI. More...

Detailed Description

Logout API

Overview

This API logs out an user from user's existing session. This API accepts user's session ID and terminates the session.
Once the session is terminated, given session ID is no longer valid and cannot be used in any subsequent user requests.

Since
11.6

Schemas used

  • schema-kb-Error

API

Method URI Description
DELETE /ws/v12/authentication/user/logout Terminates user's session, referenced by the session ID, and logs out the requesting user.

Request

Required elements to be submitted in the request body

No request body required.

Request headers

Name Description
X-egain-session Session ID
Accept-Language Optional header that is used to specify the language of error messages. Default value is the primary KB language assigned to the user.
See Supported 'Accept-Language' header language codes.

Response

The response includes HTTP status code and headers only. No response body.

Success Status Code

204 - No Content

  • User successfully logged out.

Failure Status Code

401 - UnAuthorised
  • Invalid session ID in the request header.
406 - Not Acceptable :
  • Invalid value of Accept-Language header.
500 - Internal Server Error

Response headers

Name Description
X-egain-session Session ID generated in login request.

Response body

No response body is returned on successful logout.

Error body schema

An error body is returned when the user request could not be successfully processed.
Different error codes returned by this API are listed in the 'Failure Status Code' section.

schema-kb-Error

Examples


Example 1

Request
Method URI Description Http Code Returned
DELETE /ws/v12/authentication/user/logout Assuming the user request is successfully processed, a 204 success code is returned. No response body is returned by the server in this case. 204
Response
204 - No Content

     


Example 2

Request
Method URI Description Http Code Returned
DELETE /ws/v12/authentication/user/logout Below is the error response when user's session ID is invalid and could not be authenticated by the server. 401
Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error xmlns="http://bindings.egain.com/ws/model/v12/gen/platform">
   <message>User could not be authenticated. Invalid session ID.</message>
</Error>

     


Example 3 (Json)

Request
Method URI Description Http Code Returned
DELETE /ws/v12/authentication/user/logout Below is the error response when user's session ID is invalid and could not be authenticated by the server. 401
Json Response
{
   "message": "User could not be authenticated. Invalid session ID."
}