Skip to main content

getClosedSituationsPerUserStats

A GET request that returns the number of Situations that a user has closed each hour within a given time range.

Back to Stats API.

Request arguments

Endpoint getClosedSituationsPerUserStats takes the following request arguments.

Response

Endpoint getClosedSituationsPerUserStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"Closed 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 closed by the user.

  • Less than 1 week: Returns the number ofSituations closed each hour in the time period.

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

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

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

Examples

The following examples demonstrate typical use of endpoint getClosedSituationsPerUserStats:

Request example

A cURL request to return the number of Situations closed by user 5 from 6am until midnight on October 1st 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getClosedSituationsPerUserStats" --data-urlencode 'users=[5]' --data-urlencode 'from=1538373600' --data-urlencode 'to=1538395200' --data-urlencode 'aggregation=none'

Response example

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

[{
        "datapoints":[
                [1.0,1539558000000],
                [1.0,1539561600000],
                [2.0,1539565200000],
                [5.0,1539568800000],
                [0.0,1539572400000],
                [7.0,1539576000000],
                [1.0,1539579600000],
                [0.0,1539583200000],
                [8.0,1539586800000],
                [6.0,1539590400000],
                [0.0,1539594000000],
                [0.0,1539597600000]
        ],
        "target":"Closed Situations (Chris Collins)"
}]