Fetch Analysis Trend
curl --request POST \
--url https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"groups": {
"qQuestionId": [
"qRelatedQuestionId1",
"qRelatedQuestionId1"
]
},
"type": "hourly"
}
'import requests
url = "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}"
payload = {
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"groups": { "qQuestionId": ["qRelatedQuestionId1", "qRelatedQuestionId1"] },
"type": "hourly"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromDate: '2020-01-01',
toDate: '2022-12-31',
filter: [],
groups: {qQuestionId: ['qRelatedQuestionId1', 'qRelatedQuestionId1']},
type: 'hourly'
})
};
fetch('https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fromDate' => '2020-01-01',
'toDate' => '2022-12-31',
'filter' => [
],
'groups' => [
'qQuestionId' => [
'qRelatedQuestionId1',
'qRelatedQuestionId1'
]
],
'type' => 'hourly'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}"
payload := strings.NewReader("{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}"
response = http.request(request)
puts response.read_body{
"projectId": "60de2ba329a7230061e209f6",
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"dateFilter": {
"startDate": "2020-01-01",
"endDate": "2022-12-31"
},
"responses": {
"60de3485ffcabb005be2974d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "78.50",
"min": 1,
"max": 150
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 150
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 150
}
],
"60de349dffcabb005be29752": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "12.50",
"min": 1,
"max": 15
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 15
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 15
}
],
"60de34a7ffcabb005be2975b": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "42.00",
"min": 1,
"max": 50
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 50
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 50
}
],
"60de34afffcabb005be29760": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "32.50",
"min": 1,
"max": 40
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 40
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 40
}
],
"60de3485ffcabb005be2974e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "8.00",
"min": 8,
"max": 8
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 8,
"max": 8
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 8,
"max": 8
}
],
"60de34a3ffcabb005be29757": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 10
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
}
],
"60de34a7ffcabb005be2975c": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 10
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
}
],
"60de34afffcabb005be29761": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "90.00",
"min": 90,
"max": 90
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 90,
"max": 90
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 90,
"max": 90
}
],
"60de3485ffcabb005be2974f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "55.00",
"min": 23,
"max": 87
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 23,
"max": 87
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 23,
"max": 87
}
],
"60de34a3ffcabb005be29758": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "161.50",
"min": 89,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 89,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 89,
"max": 234
}
],
"60de34a7ffcabb005be2975d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "1212.50",
"min": 82,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 82,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 82,
"max": 2343
}
],
"60de34afffcabb005be29762": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "278.00",
"min": 25,
"max": 531
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 25,
"max": 531
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 25,
"max": 531
}
],
"60de3485ffcabb005be29750": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "3432.00",
"min": 6,
"max": 3432
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "6.00",
"min": 6,
"max": 3432
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "7.00",
"min": 6,
"max": 3432
}
],
"60de34a3ffcabb005be29759": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "123.00",
"min": 8,
"max": 123
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "8.00",
"min": 8,
"max": 123
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "33.00",
"min": 8,
"max": 123
}
],
"60de34a7ffcabb005be2975e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "22.00",
"min": 10,
"max": 22
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 22
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "22.00",
"min": 10,
"max": 22
}
],
"60de34afffcabb005be29763": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "44.00",
"min": 43,
"max": 100
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "100.00",
"min": 43,
"max": 100
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "43.00",
"min": 43,
"max": 100
}
],
"60de3528ffcabb005be2983d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "285.20",
"min": 2,
"max": 1231
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "7.00",
"min": 2,
"max": 1231
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "342.00",
"min": 2,
"max": 1231
}
],
"60de3528ffcabb005be2983e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "492.60",
"min": 1,
"max": 2344
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "5.00",
"min": 1,
"max": 2344
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 1,
"max": 2344
}
],
"60de3528ffcabb005be2983f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "15.80",
"min": 0,
"max": 34
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "0.50",
"min": 0,
"max": 34
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "5.00",
"min": 0,
"max": 34
}
],
"60de3528ffcabb005be29840": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "1100.40",
"min": 1,
"max": 5434
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "13.00",
"min": 1,
"max": 5434
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "23.00",
"min": 1,
"max": 5434
}
],
"60de3564ffcabb005be29b0f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "702.40",
"min": 7,
"max": 3434
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.50",
"min": 7,
"max": 3434
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "9.00",
"min": 7,
"max": 3434
}
],
"60de3564ffcabb005be29b10": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "481.80",
"min": 2,
"max": 2342
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "17.50",
"min": 2,
"max": 2342
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "23.00",
"min": 2,
"max": 2342
}
],
"60de3564ffcabb005be29b11": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "55.40",
"min": 1,
"max": 929
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "466.50",
"min": 1,
"max": 929
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 929
}
],
"60de3564ffcabb005be29b12": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "477.40",
"min": 1,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "15.50",
"min": 1,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 2343
}
],
"60de3564ffcabb005be29b20": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "697.60",
"min": 2,
"max": 3423
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "5.50",
"min": 2,
"max": 3423
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 2,
"max": 3423
}
],
"60de3564ffcabb005be29b21": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "56.20",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "31.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 234
}
],
"60de3564ffcabb005be29b22": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "486.20",
"min": 3,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "261.00",
"min": 3,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 3,
"max": 2343
}
],
"60de3564ffcabb005be29b23": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "92.20",
"min": 1,
"max": 343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "11.00",
"min": 1,
"max": 343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "6.00",
"min": 1,
"max": 343
}
],
"60de355bffcabb005be29adb": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "75.33",
"min": 2,
"max": 213
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 213
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 2,
"max": 213
}
],
"60de355bffcabb005be29adc": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "116.67",
"min": 1,
"max": 324
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "2.00",
"min": 1,
"max": 324
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 324
}
],
"60de355bffcabb005be29add": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "87.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "23.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 2,
"max": 234
}
],
"60de355bffcabb005be29ade": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "132.00",
"min": 3,
"max": 343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "23.00",
"min": 3,
"max": 343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 3,
"max": 343
}
],
"60de3564ffcabb005be29b32": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "45.40",
"min": 2,
"max": 123
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "3.00",
"min": 2,
"max": 123
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "42.00",
"min": 2,
"max": 123
}
],
"60de3564ffcabb005be29b33": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "18.60",
"min": 2,
"max": 56
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "56.00",
"min": 2,
"max": 56
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 56
}
],
"60de3564ffcabb005be29b34": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "28.40",
"min": 2,
"max": 222
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "222.00",
"min": 2,
"max": 222
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "3.00",
"min": 2,
"max": 222
}
],
"60de3564ffcabb005be29b35": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "18.60",
"min": 3,
"max": 442
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "111.00",
"min": 3,
"max": 442
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "442.00",
"min": 3,
"max": 442
}
],
"60de3564ffcabb005be29b43": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "30.75",
"min": 7,
"max": 85
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 7,
"max": 85
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "43.00",
"min": 7,
"max": 85
}
],
"60de3564ffcabb005be29b44": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "11.00",
"min": 3,
"max": 30
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 3,
"max": 30
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "3.00",
"min": 3,
"max": 30
}
],
"60de3564ffcabb005be29b45": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "26.00",
"min": 4,
"max": 52
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 4,
"max": 52
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 4,
"max": 52
}
],
"60de3564ffcabb005be29b46": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "12.25",
"min": 5,
"max": 2222
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 5,
"max": 2222
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2222.00",
"min": 5,
"max": 2222
}
],
"60de3564ffcabb005be29b54": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "32.00",
"min": 7,
"max": 57
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "9.00",
"min": 7,
"max": 57
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "22.00",
"min": 7,
"max": 57
}
],
"60de3564ffcabb005be29b55": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "42.50",
"min": 5,
"max": 78
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.00",
"min": 5,
"max": 78
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "5.00",
"min": 5,
"max": 78
}
],
"60de3564ffcabb005be29b56": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "51.00",
"min": 7,
"max": 95
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.00",
"min": 7,
"max": 95
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "74.00",
"min": 7,
"max": 95
}
],
"60de3564ffcabb005be29b57": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "35.00",
"min": 7,
"max": 63
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "15.00",
"min": 7,
"max": 63
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "34.00",
"min": 7,
"max": 63
}
]
}
}Analysis / Trend
Fetch Analysis Trend
Description
Get trend analysis data for questions.
Payload
{
"fromDate": string,
"toDate": string,
"filter": array,
"groups": object,
"type": string,
}
where:
fromDate: start date in ISO format. Required.toDate: end date in ISO format. Required.filter: array of filters to filter the responses. Optional.groups: Object indexed by question id with aqas prefix. Every key has assigned an array with the question ids withqprefix that are the same question through different concepts inside a concept test. Only needed for project with Concept Test or Question Loops. Optional.type: Type of trend data to get the analysis data. It can be one of the following:hourly,daily,monthlyandyearly. Required.
Response
200 OK
{
"dateFilters": array,
"projectId": string,
"fromDate": string,
"toDate": string,
"filter": array,
"responses": {
"q000000000000000000000000": object,
"q000000000000000000000001": object
}
}
where:
projectId: unique identifier of the project.fromDate: start date received as param to the query in ISO format.toDate: end date received as param to the query in ISO format.dateFilters: Array of date filters used for querying the responses.filter: Array of filters sent in the request.responses: object mapping unique question identifiers to trend analysis data for every question.
400 Bad Request
Missing or invalid
projectId/type/fromDate/toDatefields.
401 Unauthorized
Invalid authorization.
404 Not Found
Resource not found.
500 Internal Server Error
Error occurred in the service.
POST
/
numeric-analysis-service
/
trend
/
{projectId}
Fetch Analysis Trend
curl --request POST \
--url https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"groups": {
"qQuestionId": [
"qRelatedQuestionId1",
"qRelatedQuestionId1"
]
},
"type": "hourly"
}
'import requests
url = "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}"
payload = {
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"groups": { "qQuestionId": ["qRelatedQuestionId1", "qRelatedQuestionId1"] },
"type": "hourly"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fromDate: '2020-01-01',
toDate: '2022-12-31',
filter: [],
groups: {qQuestionId: ['qRelatedQuestionId1', 'qRelatedQuestionId1']},
type: 'hourly'
})
};
fetch('https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fromDate' => '2020-01-01',
'toDate' => '2022-12-31',
'filter' => [
],
'groups' => [
'qQuestionId' => [
'qRelatedQuestionId1',
'qRelatedQuestionId1'
]
],
'type' => 'hourly'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}"
payload := strings.NewReader("{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://numeric-analysis.sightx.io/numeric-analysis-service/trend/{projectId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fromDate\": \"2020-01-01\",\n \"toDate\": \"2022-12-31\",\n \"filter\": [],\n \"groups\": {\n \"qQuestionId\": [\n \"qRelatedQuestionId1\",\n \"qRelatedQuestionId1\"\n ]\n },\n \"type\": \"hourly\"\n}"
response = http.request(request)
puts response.read_body{
"projectId": "60de2ba329a7230061e209f6",
"fromDate": "2020-01-01",
"toDate": "2022-12-31",
"filter": [],
"dateFilter": {
"startDate": "2020-01-01",
"endDate": "2022-12-31"
},
"responses": {
"60de3485ffcabb005be2974d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "78.50",
"min": 1,
"max": 150
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 150
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 150
}
],
"60de349dffcabb005be29752": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "12.50",
"min": 1,
"max": 15
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 15
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 15
}
],
"60de34a7ffcabb005be2975b": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "42.00",
"min": 1,
"max": 50
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 50
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 50
}
],
"60de34afffcabb005be29760": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "32.50",
"min": 1,
"max": 40
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 40
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 40
}
],
"60de3485ffcabb005be2974e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "8.00",
"min": 8,
"max": 8
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 8,
"max": 8
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 8,
"max": 8
}
],
"60de34a3ffcabb005be29757": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 10
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
}
],
"60de34a7ffcabb005be2975c": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 10
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 10,
"max": 10
}
],
"60de34afffcabb005be29761": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "90.00",
"min": 90,
"max": 90
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 90,
"max": 90
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 90,
"max": 90
}
],
"60de3485ffcabb005be2974f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "55.00",
"min": 23,
"max": 87
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 23,
"max": 87
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 23,
"max": 87
}
],
"60de34a3ffcabb005be29758": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "161.50",
"min": 89,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 89,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 89,
"max": 234
}
],
"60de34a7ffcabb005be2975d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "1212.50",
"min": 82,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 82,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 82,
"max": 2343
}
],
"60de34afffcabb005be29762": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "278.00",
"min": 25,
"max": 531
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 25,
"max": 531
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 25,
"max": 531
}
],
"60de3485ffcabb005be29750": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "3432.00",
"min": 6,
"max": 3432
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "6.00",
"min": 6,
"max": 3432
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "7.00",
"min": 6,
"max": 3432
}
],
"60de34a3ffcabb005be29759": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "123.00",
"min": 8,
"max": 123
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "8.00",
"min": 8,
"max": 123
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "33.00",
"min": 8,
"max": 123
}
],
"60de34a7ffcabb005be2975e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "22.00",
"min": 10,
"max": 22
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "10.00",
"min": 10,
"max": 22
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "22.00",
"min": 10,
"max": 22
}
],
"60de34afffcabb005be29763": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "44.00",
"min": 43,
"max": 100
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "100.00",
"min": 43,
"max": 100
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "43.00",
"min": 43,
"max": 100
}
],
"60de3528ffcabb005be2983d": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "285.20",
"min": 2,
"max": 1231
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "7.00",
"min": 2,
"max": 1231
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "342.00",
"min": 2,
"max": 1231
}
],
"60de3528ffcabb005be2983e": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "492.60",
"min": 1,
"max": 2344
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "5.00",
"min": 1,
"max": 2344
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 1,
"max": 2344
}
],
"60de3528ffcabb005be2983f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "15.80",
"min": 0,
"max": 34
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "0.50",
"min": 0,
"max": 34
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "5.00",
"min": 0,
"max": 34
}
],
"60de3528ffcabb005be29840": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "1100.40",
"min": 1,
"max": 5434
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "13.00",
"min": 1,
"max": 5434
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "23.00",
"min": 1,
"max": 5434
}
],
"60de3564ffcabb005be29b0f": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "702.40",
"min": 7,
"max": 3434
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.50",
"min": 7,
"max": 3434
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "9.00",
"min": 7,
"max": 3434
}
],
"60de3564ffcabb005be29b10": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "481.80",
"min": 2,
"max": 2342
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "17.50",
"min": 2,
"max": 2342
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "23.00",
"min": 2,
"max": 2342
}
],
"60de3564ffcabb005be29b11": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "55.40",
"min": 1,
"max": 929
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "466.50",
"min": 1,
"max": 929
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 929
}
],
"60de3564ffcabb005be29b12": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "477.40",
"min": 1,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "15.50",
"min": 1,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "1.00",
"min": 1,
"max": 2343
}
],
"60de3564ffcabb005be29b20": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "697.60",
"min": 2,
"max": 3423
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "5.50",
"min": 2,
"max": 3423
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 2,
"max": 3423
}
],
"60de3564ffcabb005be29b21": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "56.20",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "31.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 234
}
],
"60de3564ffcabb005be29b22": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "486.20",
"min": 3,
"max": 2343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "261.00",
"min": 3,
"max": 2343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 3,
"max": 2343
}
],
"60de3564ffcabb005be29b23": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "92.20",
"min": 1,
"max": 343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "11.00",
"min": 1,
"max": 343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "6.00",
"min": 1,
"max": 343
}
],
"60de355bffcabb005be29adb": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "75.33",
"min": 2,
"max": 213
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 213
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 2,
"max": 213
}
],
"60de355bffcabb005be29adc": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "116.67",
"min": 1,
"max": 324
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "2.00",
"min": 1,
"max": 324
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 1,
"max": 324
}
],
"60de355bffcabb005be29add": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "87.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "23.00",
"min": 2,
"max": 234
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 2,
"max": 234
}
],
"60de355bffcabb005be29ade": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "132.00",
"min": 3,
"max": 343
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "23.00",
"min": 3,
"max": 343
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": 0,
"min": 3,
"max": 343
}
],
"60de3564ffcabb005be29b32": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "45.40",
"min": 2,
"max": 123
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "3.00",
"min": 2,
"max": 123
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "42.00",
"min": 2,
"max": 123
}
],
"60de3564ffcabb005be29b33": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "18.60",
"min": 2,
"max": 56
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "56.00",
"min": 2,
"max": 56
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2.00",
"min": 2,
"max": 56
}
],
"60de3564ffcabb005be29b34": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "28.40",
"min": 2,
"max": 222
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "222.00",
"min": 2,
"max": 222
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "3.00",
"min": 2,
"max": 222
}
],
"60de3564ffcabb005be29b35": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "18.60",
"min": 3,
"max": 442
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "111.00",
"min": 3,
"max": 442
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "442.00",
"min": 3,
"max": 442
}
],
"60de3564ffcabb005be29b43": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "30.75",
"min": 7,
"max": 85
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 7,
"max": 85
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "43.00",
"min": 7,
"max": 85
}
],
"60de3564ffcabb005be29b44": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "11.00",
"min": 3,
"max": 30
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 3,
"max": 30
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "3.00",
"min": 3,
"max": 30
}
],
"60de3564ffcabb005be29b45": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "26.00",
"min": 4,
"max": 52
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 4,
"max": 52
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "4.00",
"min": 4,
"max": 52
}
],
"60de3564ffcabb005be29b46": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "12.25",
"min": 5,
"max": 2222
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": 0,
"min": 5,
"max": 2222
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "2222.00",
"min": 5,
"max": 2222
}
],
"60de3564ffcabb005be29b54": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "32.00",
"min": 7,
"max": 57
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "9.00",
"min": 7,
"max": 57
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "22.00",
"min": 7,
"max": 57
}
],
"60de3564ffcabb005be29b55": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "42.50",
"min": 5,
"max": 78
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.00",
"min": 5,
"max": 78
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "5.00",
"min": 5,
"max": 78
}
],
"60de3564ffcabb005be29b56": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "51.00",
"min": 7,
"max": 95
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "20.00",
"min": 7,
"max": 95
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "74.00",
"min": 7,
"max": 95
}
],
"60de3564ffcabb005be29b57": [
{
"x": "2021-07-01T16:00:00.000Z",
"mean": "35.00",
"min": 7,
"max": 63
},
{
"x": "2021-07-01T17:00:00.000Z",
"mean": "15.00",
"min": 7,
"max": 63
},
{
"x": "2021-07-01T22:00:00.000Z",
"mean": "34.00",
"min": 7,
"max": 63
}
]
}
}Description
Get trend analysis data for questions.Payload
{
"fromDate": string,
"toDate": string,
"filter": array,
"groups": object,
"type": string,
}
fromDate: start date in ISO format. Required.toDate: end date in ISO format. Required.filter: array of filters to filter the responses. Optional.groups: Object indexed by question id with aqas prefix. Every key has assigned an array with the question ids withqprefix that are the same question through different concepts inside a concept test. Only needed for project with Concept Test or Question Loops. Optional.type: Type of trend data to get the analysis data. It can be one of the following:hourly,daily,monthlyandyearly. Required.
Response
200 OK
{
"dateFilters": array,
"projectId": string,
"fromDate": string,
"toDate": string,
"filter": array,
"responses": {
"q000000000000000000000000": object,
"q000000000000000000000001": object
}
}
projectId: unique identifier of the project.fromDate: start date received as param to the query in ISO format.toDate: end date received as param to the query in ISO format.dateFilters: Array of date filters used for querying the responses.filter: Array of filters sent in the request.responses: object mapping unique question identifiers to trend analysis data for every question.
400 Bad Request
Missing or invalidprojectId/type/fromDate/toDatefields.
401 Unauthorized
Invalid authorization.
404 Not Found
Resource not found.
500 Internal Server Error
Error occurred in the service.
Was this page helpful?
⌘I