getRatedSituationsPerUserStats

A GET request that returns the number of Situations rated by a user within a given time range.

Back to Stats API.

Request arguments

Endpoint getRatedSituationsPerUserStats takes the following request arguments.

Response

Endpoint getRatedSituationsPerUserStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"Rated 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 rated by the user.

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

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

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

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

Examples

The following examples demonstrate typical use of endpoint getRatedSituationsPerUserStats:

Request example

A cURL request to return the number of Situations rated by users 5 and 7 from 3:57am until 9:57am on Thursday, October 5th 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getRatedSituationsPerUserStats" --data-urlencode 'users=[5,7]' --data-urlencode 'from=1538621843' --data-urlencode 'to=1538643443'

Response example

A successful response returns the number of Situations rated by the users Steve and Charlie each hour during the time range:

[{
        "datapoints":[
                [6.0,1538621843000],    
                [1.0,1538625443000],
                [6.0,1538629043000],
                [5.0,1538632643000],
                [2.0,1538636243000],
                [5.0,1538639843000]
        ],
        "target":"Rated Situations (Steve Smith)"
  },
  {
        "datapoints":[
                [0.0,1538621843000],
                [3.0,1538625443000],
                [1.0,1538629043000],
                [6.0,1538632643000],
                [6.0,1538636243000],
                [8.0,1538639843000]
        ],
        "target":"Rated Situations (Charlie Copper)"
}]