Skip to main content

getViewedSituationsPerUserStats

A GET request that returns the number of Situations a user has viewed within a given time range. Moogsoft Enterprise considers a user to have viewed a Situation if they opened the Situation Room.

Back to Stats API.

Request arguments

Endpoint getViewedSituationsPerUserStats takes the following request arguments.

Response

Endpoint getViewedSituationsPerUserStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"Viewed Situations (full name)"

datapoints

Number Array

An array of data points. Each data point is an array in the format [data point, timestamp]:

  1. Data point: Number of Situations viewed by the user.

  • Less than 1 week: Returns the number of Situations viewed each hour in the time period.

  • 1 week to 1 month: Returns the number of Situations viewed each day in the time period.

  • 1 month to 1 year: Returns the number of Situations viewed each week in the time period.

  • More than 1 year: Returns the number of Situations viewed each month in the time period.

Examples

The following examples demonstrate typical use of endpoint getViewedSituationsPerUserStats:

Request example

A cURL request to return the number of viewed Situations by user 7 from 9am until 3pm on Thursday, 20th September 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getViewedSituationsPerUserStats" --data-urlencode 'users=[7]' --data-urlencode 'from=1537434000' --data-urlencode 'to=1537455600' --data-urlencode 'aggregation=none'

Response example

A successful response returns the number of Situations viewed by the user Charlie each hour during the time range:

[{
        "datapoints":[
                [16.0,1537434000000],
                [26.0,1537437600000],
                [18.0,1537441200000],
                [34.0,1537444800000],
                [18.0,1537448400000],
                [11.0,1537452000000]
        ],
        "target":"Viewed Situations (Charlie Cooper)"
}]