Logging Out

In order to log out, it is required to invalidate the user session that was created when logging in. If cookies are being used, the cookie will also be invalidated. Two options for logging out are being offered - either invalidate a single session or else, invalidate all sessions that are active on your user ID.

Invalidating a Single Session

You use the following POST request to invalidate a single session.

POST /auth/logout

If no JSON data is sent, the system expects to find a valid authentication cookie. If such a cookie is found, the cookie is deleted, and the session is invalidated from the server. If JSON data is sent, then the session and user ID are read from the JSON object as described below.

If this request is done via POST, then a JSON response as described below will be returned. If GET is used, the response is not in JSON but in user-friendly HTML. If you are using GET and still would like to receive a JSON response, add the parameter resultFormat=raw so the URL should be https://api.revulytics.com/auth/logout?resultFormat=raw.

This request to invalidate a single session the following properties.

Invalidating a Single Session Properties

Property

Description

Request JSON Object

user (string)—The username of your Usage Intelligence user account
sessionId (string)—The sessionId obtained via POST /auth/login.

Request Headers

Content-Type—Can be set to application/json or text/javascript 
Accept—Should be set to text/javascript 

Response Headers

Content-Type—Will contain text/javascript 

Status Codes

200 OK—OK (no error)
400 Bad Request—Malformed request
403 Forbidden—Wrong credentials supplied

Response JSON Object

status (string)—Contains OK if successful or SYNTAX ERROR or AUTH ERROR.
reason (string)—Present only if status is not OK. Contains error message (reason).