Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

REQUEST

This API is used to get the web session of the user.

The structure of API as below:

GET

/auth/session/list

 

It also allows user to query/sort data by some parameters as below:

ParametersDescription
pageThe total you want to display in return message.
per_pageThe total of records you want to display on a page.
order_bySelect the type of order: ascending or descending.
order_dirSelect the field to order data.
agentQuery data by browser/environment that is used to login to server.
hostQuery data by host that is used to login to server.
idQuery by ID of session
msgQuery data by return message.
user_idQuery data by user_id.
create_time_gtQuery data by timezone of creating time.
create_time_ltQuery data by the date time when session started.

 

HEADER

The request requires you given the Token of the user in headers.

Code Block
{
	"accept": "application/json",
	"X-Auth-Token": "Admin Token"
}

 

If you call API without header, the system will return the message as below:

Code Block
{
  	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "No header X-Auth-Token present",
      	"code": 110,
      	"reason": "auth_token_not_provided"
   	}
}

JSON RESPONSE

There is message return as JSON format. It will return the result of API and the related information as well.

If you provide correct token, the server will return code 200 with a message as below:

Code Block
{
  	"success": true,
  	"payload": {The list of web session}
}

 

If you provide the wrong token, the server will return code 120 with a message as below:

Code Block
{
   	"error_type": "unauthenticated_error",
   	"success": false,
   	"error":    {
      	"message": "Incorrect token provided",
      	"code": 120,
      	"reason": "incorrect_token_provided"
   	}
}
Panel

On this page:

Table of Contents

 

EXAMPLE

We will know more about the API through the example below:

Request

I will call API to get the list of web session as below:

Code Block
curl \
-H "X-Auth-Token: eyaskjksadkasd9.9123kjsadhkj123jhasdjajsjsdhKS.IH5uHASSJsadnbads980asTHo9dhljM" \
-X GET "http://88.99.175.131:8000/v1/auth/session/list"
 

Response

Code Block
{
 	"success": true,
  	"payload": {
   	"per_page": 30,
   	"items": [
      	{
   		"host": "31.207.163.147",
        "user_id": 1,
        "user_name": "admin",
        "msg": null,
        "create_time": "2018-02-06T17:23:49.860612+00:00",
        "id": 22521,
        "agent": "Swagger-Codegen/1.0.0/python"
      	},
      	{
        "host": "203.163.235.126",
        "user_id": 1584,
        "user_name": null,
        "msg": null,
        "create_time": "2018-02-06T17:21:35.999162+00:00",
        "id": 22522,
        "agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
      	}
	]}
}