Skip to main content

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

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

username

String

Yes

Name of the user.

from

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.

to

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.

start

Number

No

Starting record from which data should be included. Default is 0, the first record.

limit

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

sessionId

Number

ID of the session.

startTime

Number

Start time of the session, in Unix epoch time.

lastAccess

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
    }
]