Submit bulk metrics for a card
curl --request POST \
--url https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metrics": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk"
payload = { "metrics": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
] }
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({metrics: [{value: 123, timestamp: '2023-11-07T05:31:56Z'}]})
};
fetch('https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk', 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.vistaly.com/v1/cards/{cardId}/metrics/bulk",
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([
'metrics' => [
[
'value' => 123,
'timestamp' => '2023-11-07T05:31:56Z'
]
]
]),
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://api.vistaly.com/v1/cards/{cardId}/metrics/bulk"
payload := strings.NewReader("{\n \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\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://api.vistaly.com/v1/cards/{cardId}/metrics/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk")
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 \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bulk metric import completed",
"succeeded": 950,
"failed": [
{
"index": 42,
"metric": {
"value": -1,
"timestamp": "2024-01-01T00:00:00Z"
},
"error": "Unknown error occurred"
}
]
}{
"message": "Bad request"
}{
"message": "Unauthorized"
}{
"message": "Forbidden"
}{
"message": "Internal Server Error"
}cards
Submit bulk metrics for a card
Submit multiple metrics related to a specific card identified by cardId. This allows for bulk import of metric datapoints for tracking and performance measurement.
POST
/
v1
/
cards
/
{cardId}
/
metrics
/
bulk
Submit bulk metrics for a card
curl --request POST \
--url https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metrics": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
'import requests
url = "https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk"
payload = { "metrics": [
{
"value": 123,
"timestamp": "2023-11-07T05:31:56Z"
}
] }
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({metrics: [{value: 123, timestamp: '2023-11-07T05:31:56Z'}]})
};
fetch('https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk', 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.vistaly.com/v1/cards/{cardId}/metrics/bulk",
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([
'metrics' => [
[
'value' => 123,
'timestamp' => '2023-11-07T05:31:56Z'
]
]
]),
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://api.vistaly.com/v1/cards/{cardId}/metrics/bulk"
payload := strings.NewReader("{\n \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\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://api.vistaly.com/v1/cards/{cardId}/metrics/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vistaly.com/v1/cards/{cardId}/metrics/bulk")
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 \"metrics\": [\n {\n \"value\": 123,\n \"timestamp\": \"2023-11-07T05:31:56Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bulk metric import completed",
"succeeded": 950,
"failed": [
{
"index": 42,
"metric": {
"value": -1,
"timestamp": "2024-01-01T00:00:00Z"
},
"error": "Unknown error occurred"
}
]
}{
"message": "Bad request"
}{
"message": "Unauthorized"
}{
"message": "Forbidden"
}{
"message": "Internal Server Error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier for the card whose metrics are being submitted.
Body
application/json
Array of metric datapoints to be created
Required array length:
1 - 1000 elementsShow child attributes
Show child attributes
⌘I