Calculate a conversation metric
curl --request POST \
--url 'https://api.vida.dev/api/v2/logs/timeSeries?token=' \
--header 'Content-Type: application/json' \
--data '
{
"targetAccountId": 123,
"startAt": 123,
"endAt": 123,
"definition": {
"formula": "transfer == true",
"aggregation": {},
"filters": {},
"fieldTypes": {},
"minimumSampleSize": 2
},
"includeTimeSeries": true,
"search": "<string>",
"sort": "metricValue",
"direction": "desc",
"page": 1,
"pageSize": 25,
"refresh": false
}
'import requests
url = "https://api.vida.dev/api/v2/logs/timeSeries?token="
payload = {
"targetAccountId": 123,
"startAt": 123,
"endAt": 123,
"definition": {
"formula": "transfer == true",
"aggregation": {},
"filters": {},
"fieldTypes": {},
"minimumSampleSize": 2
},
"includeTimeSeries": True,
"search": "<string>",
"sort": "metricValue",
"direction": "desc",
"page": 1,
"pageSize": 25,
"refresh": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
targetAccountId: 123,
startAt: 123,
endAt: 123,
definition: {
formula: 'transfer == true',
aggregation: {},
filters: {},
fieldTypes: {},
minimumSampleSize: 2
},
includeTimeSeries: true,
search: '<string>',
sort: 'metricValue',
direction: 'desc',
page: 1,
pageSize: 25,
refresh: false
})
};
fetch('https://api.vida.dev/api/v2/logs/timeSeries?token=', 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://api.vida.dev/api/v2/logs/timeSeries?token=",
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([
'targetAccountId' => 123,
'startAt' => 123,
'endAt' => 123,
'definition' => [
'formula' => 'transfer == true',
'aggregation' => [
],
'filters' => [
],
'fieldTypes' => [
],
'minimumSampleSize' => 2
],
'includeTimeSeries' => true,
'search' => '<string>',
'sort' => 'metricValue',
'direction' => 'desc',
'page' => 1,
'pageSize' => 25,
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.vida.dev/api/v2/logs/timeSeries?token="
payload := strings.NewReader("{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.vida.dev/api/v2/logs/timeSeries?token=")
.header("Content-Type", "application/json")
.body("{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/logs/timeSeries?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"aggregate": 123,
"metricTotal": 123,
"eventCount": 1,
"minimumSampleSize": 2,
"qualified": true,
"timeSeries": {},
"timeSeriesEventCounts": {},
"groups": [
{
"organizationId": 123,
"organizationName": "<string>",
"agentId": 123,
"agentName": "<string>",
"metricValue": 123,
"metricTotal": 123,
"eventCount": 1
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"totalCount": 123,
"totalPages": 123
}
}Conversation Logs
Calculate a conversation metric
Calculates an aggregate metric from conversation logs for the selected account and time range. Results can also include time buckets and, for eligible reseller accounts, organization or agent comparisons. Use the normal conversation logs endpoint to inspect the records behind a metric.
POST
/
api
/
v2
/
logs
/
timeSeries
Calculate a conversation metric
curl --request POST \
--url 'https://api.vida.dev/api/v2/logs/timeSeries?token=' \
--header 'Content-Type: application/json' \
--data '
{
"targetAccountId": 123,
"startAt": 123,
"endAt": 123,
"definition": {
"formula": "transfer == true",
"aggregation": {},
"filters": {},
"fieldTypes": {},
"minimumSampleSize": 2
},
"includeTimeSeries": true,
"search": "<string>",
"sort": "metricValue",
"direction": "desc",
"page": 1,
"pageSize": 25,
"refresh": false
}
'import requests
url = "https://api.vida.dev/api/v2/logs/timeSeries?token="
payload = {
"targetAccountId": 123,
"startAt": 123,
"endAt": 123,
"definition": {
"formula": "transfer == true",
"aggregation": {},
"filters": {},
"fieldTypes": {},
"minimumSampleSize": 2
},
"includeTimeSeries": True,
"search": "<string>",
"sort": "metricValue",
"direction": "desc",
"page": 1,
"pageSize": 25,
"refresh": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
targetAccountId: 123,
startAt: 123,
endAt: 123,
definition: {
formula: 'transfer == true',
aggregation: {},
filters: {},
fieldTypes: {},
minimumSampleSize: 2
},
includeTimeSeries: true,
search: '<string>',
sort: 'metricValue',
direction: 'desc',
page: 1,
pageSize: 25,
refresh: false
})
};
fetch('https://api.vida.dev/api/v2/logs/timeSeries?token=', 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://api.vida.dev/api/v2/logs/timeSeries?token=",
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([
'targetAccountId' => 123,
'startAt' => 123,
'endAt' => 123,
'definition' => [
'formula' => 'transfer == true',
'aggregation' => [
],
'filters' => [
],
'fieldTypes' => [
],
'minimumSampleSize' => 2
],
'includeTimeSeries' => true,
'search' => '<string>',
'sort' => 'metricValue',
'direction' => 'desc',
'page' => 1,
'pageSize' => 25,
'refresh' => false
]),
CURLOPT_HTTPHEADER => [
"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://api.vida.dev/api/v2/logs/timeSeries?token="
payload := strings.NewReader("{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.vida.dev/api/v2/logs/timeSeries?token=")
.header("Content-Type", "application/json")
.body("{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/logs/timeSeries?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"targetAccountId\": 123,\n \"startAt\": 123,\n \"endAt\": 123,\n \"definition\": {\n \"formula\": \"transfer == true\",\n \"aggregation\": {},\n \"filters\": {},\n \"fieldTypes\": {},\n \"minimumSampleSize\": 2\n },\n \"includeTimeSeries\": true,\n \"search\": \"<string>\",\n \"sort\": \"metricValue\",\n \"direction\": \"desc\",\n \"page\": 1,\n \"pageSize\": 25,\n \"refresh\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"aggregate": 123,
"metricTotal": 123,
"eventCount": 1,
"minimumSampleSize": 2,
"qualified": true,
"timeSeries": {},
"timeSeriesEventCounts": {},
"groups": [
{
"organizationId": 123,
"organizationName": "<string>",
"agentId": 123,
"agentName": "<string>",
"metricValue": 123,
"metricTotal": 123,
"eventCount": 1
}
],
"pagination": {
"page": 123,
"pageSize": 123,
"totalCount": 123,
"totalPages": 123
}
}Body
application/json
Response
Metric calculated successfully