Skip to main content

getOpenSituationsPerUserStats

A GET request that returns the number of open Situations assigned to a user at each data point.

Back to Stats API.

Request arguments

Endpoint getOpenSituationsPerUserStats takes the following request arguments.

Response

Endpoint getOpenSituationsPerUserStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"Open 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 open Situations assigned to the user.

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

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

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

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

Examples

The following examples demonstrate typical use of endpoint getOpenSituationsPerUserStats:

Request example

A cURL request to return the number of open Situations assigned to user 6 from 9.19am on Monday, 17th September until 16.19am on Monday, 17th September 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getOpenSituationsPerUserStats" --data-urlencode 'users=[6,7]' --data-urlencode 'from=1537175946' --data-urlencode 'to=1537201140' --data-urlencode 'aggregation=none'

Response example

A successful response returns the number of open Situations assigned to the users Oscar and Olivia each hour during the time range:

[{
        "datapoints":[
                [12.0,1537175946000],
                [8.875,1537262346000],
                [10.0,1537348746000],
                [8.9,1537435146000],
                [10.75,1537521546000],
                [9.25,1537607946000],
                [8.1667,1537694346000]
        ],
        "target":"Open Situations (Oscar O'Neill)"
},
{
        "datapoints":[
                [4.0,1537175946000],
                [5.0,1537262346000],
                [12.0,1537348746000],
                [7.0,1537435146000],
                [3.0,1537521546000],
                [9.0,1537607946000],
                [8.0,1537694346000]
        ],
        "target":"Open Situations (Andrew Anderson)"
}
]