Get Interactions Time-Series
curl --request POST \
--url https://backend.nebuly.com/api/external/get-interaction-time-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"start": "<string>",
"end": "<string>"
},
"filters": [
{
"kind": "<string>",
"tag": "<string>",
"values": [
"<string>"
]
}
],
"variables": [
"<string>"
],
"granularity": "<string>"
}
'import requests
url = "https://backend.nebuly.com/api/external/get-interaction-time-series"
payload = {
"time_range": {
"start": "<string>",
"end": "<string>"
},
"filters": [
{
"kind": "<string>",
"tag": "<string>",
"values": ["<string>"]
}
],
"variables": ["<string>"],
"granularity": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_range: {start: '<string>', end: '<string>'},
filters: [{kind: '<string>', tag: '<string>', values: ['<string>']}],
variables: ['<string>'],
granularity: '<string>'
})
};
fetch('https://backend.nebuly.com/api/external/get-interaction-time-series', 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://backend.nebuly.com/api/external/get-interaction-time-series",
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([
'time_range' => [
'start' => '<string>',
'end' => '<string>'
],
'filters' => [
[
'kind' => '<string>',
'tag' => '<string>',
'values' => [
'<string>'
]
]
],
'variables' => [
'<string>'
],
'granularity' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://backend.nebuly.com/api/external/get-interaction-time-series"
payload := strings.NewReader("{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://backend.nebuly.com/api/external/get-interaction-time-series")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.nebuly.com/api/external/get-interaction-time-series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"buckets": [
"<string>"
],
"datasets": {
"<group_by_value>": [
{
"bucket": "<string>",
"n_interactions": 123,
"n_interactions_prev": 123,
"n_users": 123,
"n_users_prev": 123,
"n_positive_implicit_user_feedback": 123,
"n_positive_implicit_user_feedback_prev": 123,
"n_negative_implicit_user_feedback": 123,
"n_negative_implicit_user_feedback_prev": 123,
"n_positive_explicit_user_feedback": 123,
"n_positive_explicit_user_feedback_prev": 123,
"n_negative_explicit_user_feedback": 123,
"n_negative_explicit_user_feedback_prev": 123
}
]
}
}Insights API
Get Interactions Time-Series
POST
/
api
/
external
/
get-interaction-time-series
Get Interactions Time-Series
curl --request POST \
--url https://backend.nebuly.com/api/external/get-interaction-time-series \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"time_range": {
"start": "<string>",
"end": "<string>"
},
"filters": [
{
"kind": "<string>",
"tag": "<string>",
"values": [
"<string>"
]
}
],
"variables": [
"<string>"
],
"granularity": "<string>"
}
'import requests
url = "https://backend.nebuly.com/api/external/get-interaction-time-series"
payload = {
"time_range": {
"start": "<string>",
"end": "<string>"
},
"filters": [
{
"kind": "<string>",
"tag": "<string>",
"values": ["<string>"]
}
],
"variables": ["<string>"],
"granularity": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_range: {start: '<string>', end: '<string>'},
filters: [{kind: '<string>', tag: '<string>', values: ['<string>']}],
variables: ['<string>'],
granularity: '<string>'
})
};
fetch('https://backend.nebuly.com/api/external/get-interaction-time-series', 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://backend.nebuly.com/api/external/get-interaction-time-series",
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([
'time_range' => [
'start' => '<string>',
'end' => '<string>'
],
'filters' => [
[
'kind' => '<string>',
'tag' => '<string>',
'values' => [
'<string>'
]
]
],
'variables' => [
'<string>'
],
'granularity' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://backend.nebuly.com/api/external/get-interaction-time-series"
payload := strings.NewReader("{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://backend.nebuly.com/api/external/get-interaction-time-series")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.nebuly.com/api/external/get-interaction-time-series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_range\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"filters\": [\n {\n \"kind\": \"<string>\",\n \"tag\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"variables\": [\n \"<string>\"\n ],\n \"granularity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"buckets": [
"<string>"
],
"datasets": {
"<group_by_value>": [
{
"bucket": "<string>",
"n_interactions": 123,
"n_interactions_prev": 123,
"n_users": 123,
"n_users_prev": 123,
"n_positive_implicit_user_feedback": 123,
"n_positive_implicit_user_feedback_prev": 123,
"n_negative_implicit_user_feedback": 123,
"n_negative_implicit_user_feedback_prev": 123,
"n_positive_explicit_user_feedback": 123,
"n_positive_explicit_user_feedback_prev": 123,
"n_negative_explicit_user_feedback": 123,
"n_negative_explicit_user_feedback_prev": 123
}
]
}
}You need an API key to authenticate. See here for more information about the API keys.
object
required
object[]
required
Filters you can use to get data based only on the interactions you are interested in.
Show properties
Show properties
string
required
The filter kind. It can be one of the following values:
- user_intent
- negative_user_intent
- keyword
- user_feedback
- tag
- type_of_problem
- topic
- user
- user_query
string
Optional field to be used only when the kind is tag. It should specify the tag name, which is the same as the key you used in the tags dictionary during the interaction submission.
string[]
required
The values of the selected filter you want to filter on. Note that all the values passed in
the list are considered to be in “or” the one with the other. This means that if the kind is
“topic” and the passed values are “value A”, “value B”, this is equal to
topic="value A" or topic="value B".string[]
The variables for which values are required. If not specified, all available variables will be computed.
The supported variables are
- n_interactions
- n_users
- user_feedback
- cost
- latency_seconds
- n_intents
- retention
string
required
The granularity selected for the time-series chart. It can be a value between:
- hour
- day
- week
- month
Response
string[]
X axis values accordingly to the selected granularity.
object
The data to be shown on the y axis. Note that the object has as keys the values that correspond to the different group_by values, if a group by has been selected, otherwise a unique key “total” is returned.
object[]
Each object in the list corresponds to a different x,y pairs.
Show properties
Show properties
string
The x axis value.
integer
The total number of interaction for the selected granularity and given x-value.
integer
The total number of interaction for the selected granularity, but referring to the previous time-range respect the one considered.
integer
The total number of distinct users for the selected granularity and given x-value.
integer
The total number of distinct users for the selected granularity, but referring to the previous time-range respect the one considered.
integer
The total number of positive implicit feedback for the selected granularity and given x-value.
integer
The total number of positive implicit feedback for the selected granularity, but referring to the previous time-range respect the one considered.
integer
The total number of negative implicit feedback for the selected granularity and given x-value.
integer
The total number of negative implicit feedback for the selected granularity, but referring to the previous time-range respect the one considered.
integer
The total number of positive explicit feedback for the selected granularity and given x-value.
integer
The total number of positive explicit feedback for the selected granularity, but referring to the previous time-range respect the one considered.
integer
The total number of negative explicit feedback for the selected granularity and given x-value.
integer
The total number of negative explicit feedback for the selected granularity, but referring to the previous time-range respect the one considered.
⌘I