getUserSessionInfo
A Graze API GET request that returns session information for a single user over a period of time.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getUserSessionInfo
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| String | Yes | Name of the user. |
| Number | No | Start time of the period you want to retrieve session information for. This is in Unix epoch time in seconds. If empty, returns all session information for the user. |
| Number | No | End time of the period you want to retrieve session information for. This is in Unix epoch time in seconds. If empty, returns user records to date. |
| Number | No | Starting record from which data should be included. Default is 0, the first record. |
| Number | No | Maximum number of records you want to return. Default is 200. |
Response
Endpoint getUserSessionInfo
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| Number | ID of the session. |
| Number | Start time of the session, in Unix epoch time. |
| Number | Last access time within the session, in Unix epoch time. |
Examples
The following examples demonstrate typical use of endpoint getUserSessionInfo
:
Request example
Example cURL request to return the session information for user "admin:
curl -G -u graze:graze -k "https://localhost/graze/v1/getUserSessionInfo?username=admin" \ -H "accept: application/json"
Response example
Example response returning the session information for user "admin":
[ { "sessionId": 1, "startTime": 1571665580, "lastAccess": 1571665582 }, { "sessionId": 3, "startTime": 1571666307, "lastAccess": 1571666760 } ]