Skip to main content

getNewSituationsStats

A GET request that returns the number of new Situations created in the specified time range.

Back to Stats API.

Request arguments

Endpoint getNewSituationsStats takes the following request arguments.

Response

Endpoint getNewSituationsStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"New Situations"

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 new Situations.

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

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

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

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

Examples

The following examples demonstrate typical use of endpoint getNewSituationsStats:

Request example

Example cURL request to retrieve the number of new Situations over a week from 6am on Saturday, September 1st until 6am on Saturday, September 8th 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getNewSituationsStats" --data-urlencode 'from=1535781600' --data-urlencode 'to=1536386400'

Response example

Example response returning the number of new Situations for each day during the week range:

[
        {"datapoints":[
                [601.0,1535781600000],
                [523.0,1535868000000],
                [597.0,1535954400000],
                [618.0,1536040800000],
                [535.0,1536127200000],
                [628.0,1536213600000],
                [618.0,1536300000000]
        ],
        "target":"New situations"}
]