Definition

GET - 3/surveys/{surveyId}/questions/{questionId}/aggregates?filter={filter}&period={period}&responseId={responseId}

Retrieve the aggregates (Average, Median, StandardDeviation, NPS) from a question by the question label.

Required roles: Results (read)
Response cached for 60 seconds.

Request information

surveyId

The id of a survey.


Type integer
Additional info
Required
questionId

The datalabel of a question.


Type string
Additional info
Required
filter

Select only the respondents that satisfy the predicate expression, only these respondents will be used to calculate the result. read more


Type string
Additional info
Optional
period

When you want a timeline of the aggregates you can group the results by day, week, month, quarter or year.


Type string
Additional info
Optional, Default value is null
responseId

Filter on a specific response


Type integer
Additional info
Optional, Default value is 0

Response information

Payload containing the average, median, standarddeviation and optionally the NPS of a question.


Meta

The metadata such as paging parameters, status code, timestamp,... which are related to this request.


Type MetaData
Data

The actual data returned by the request.


Type Collection of QuestionAggregate
Links

HATEOAS related to this object. It wil contain relevant url's such as previous and next page for paged results, create/update/delete action. These url's can be used in your application for the next steps in your application logic.


Type Hateoas
Sample:
{
  "Meta": {
    "Status": 1,
    "TotalRowCount": 1,
    "Limit": 1,
    "Offset": 1,
    "TotalPageCount": 1,
    "StartRec": 1,
    "StopRec": 1,
    "Timestamp": "2024-04-20T07:28:54.5537417Z",
    "IsFiltered": true
  },
  "Data": [
    {
      "Date": "sample string 1",
      "ResponseCount": 2,
      "NPS": 3.1,
      "Median": 4.1,
      "Average": 5.1,
      "StandardDeviation": 6.1,
      "Sum": 7.1,
      "AverageScore": 8.1,
      "MedianScore": 9.1
    },
    {
      "Date": "sample string 1",
      "ResponseCount": 2,
      "NPS": 3.1,
      "Median": 4.1,
      "Average": 5.1,
      "StandardDeviation": 6.1,
      "Sum": 7.1,
      "AverageScore": 8.1,
      "MedianScore": 9.1
    }
  ]
}
Sample:
<Payload xmlns:i="http://www.w3.org/2001/XMLSchema-instance" z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
  <Data>
    <QuestionAggregate z:Id="i2">
      <Average>5.1</Average>
      <AverageScore>8.1</AverageScore>
      <Date>sample string 1</Date>
      <Median>4.1</Median>
      <MedianScore>9.1</MedianScore>
      <NPS>3.1</NPS>
      <ResponseCount>2</ResponseCount>
      <StandardDeviation>6.1</StandardDeviation>
      <Sum>7.1</Sum>
    </QuestionAggregate>
    <QuestionAggregate z:Ref="i2" />
  </Data>
  <Meta>
    <IsFiltered>true</IsFiltered>
    <Limit>1</Limit>
    <Offset>1</Offset>
    <StartRec>1</StartRec>
    <Status>1</Status>
    <StopRec>1</StopRec>
    <Timestamp>2024-04-20T07:28:54.5537417+00:00</Timestamp>
    <TotalPageCount>1</TotalPageCount>
    <TotalRowCount>1</TotalRowCount>
  </Meta>
</Payload>