getAllSessionInfo

A Graze API GET request that returns session information for all users over a period of time.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getAllSessionInfo takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

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 all users.

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 getAllSessionInfo returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

sessionId

Number

ID of the session.

userName

String

User name for 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 getAllSessionInfo:

Request example

Example cURL request to return session information for all users:

curl -G -u graze:graze -k "https://localhost/graze/v1/getAllSessionInfo" --data-urlencode "from=1578655174" --data-urlencode "start=1" --data-urlencode "limit=6"

Response example

Example response returning six session information records for all users, starting at record 2:

[
    {
        "sessionId": 2,
        "userName": "user1",
        "startTime": 1571666244,
        "lastAccess": 1571666301
    },
    {
        "sessionId": 3,
        "userName": "admin",
        "startTime": 1571666307,
        "lastAccess": 1571666760
    },
    {
        "sessionId": 4,
        "userName": "user3",
        "startTime": 1571666764,
        "lastAccess": 1571673384
    },
    {
        "sessionId": 5,
        "userName": "user1",
        "startTime": 1571735292,
        "lastAccess": 1571738917
    },
    {
        "sessionId": 6,
        "userName": "graze",
        "startTime": 1571784397,
        "lastAccess": 1571784401
    },
    {
        "sessionId": 7,
        "userName": "admin",
        "startTime": 1571799980,
        "lastAccess": 1571800581
    }
]