Test-case execution history (batch)
curl --request POST \
--url https://api.empirical.run/api/v2/analytics/test-case-history/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"test_case_ids": [
"<string>"
],
"project_id": 2,
"days": 45,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 500
}
'import requests
url = "https://api.empirical.run/api/v2/analytics/test-case-history/batch"
payload = {
"test_case_ids": ["<string>"],
"project_id": 2,
"days": 45,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 500
}
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({
test_case_ids: ['<string>'],
project_id: 2,
days: 45,
start_date: '<string>',
end_date: '<string>',
environment_id: '<string>',
limit_per_test_case: 500
})
};
fetch('https://api.empirical.run/api/v2/analytics/test-case-history/batch', 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.empirical.run/api/v2/analytics/test-case-history/batch",
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([
'test_case_ids' => [
'<string>'
],
'project_id' => 2,
'days' => 45,
'start_date' => '<string>',
'end_date' => '<string>',
'environment_id' => '<string>',
'limit_per_test_case' => 500
]),
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.empirical.run/api/v2/analytics/test-case-history/batch"
payload := strings.NewReader("{\n \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\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.empirical.run/api/v2/analytics/test-case-history/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/v2/analytics/test-case-history/batch")
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 \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\n}"
response = http.request(request)
puts response.read_body{
"data": {
"history_by_test_case_id": {}
},
"meta": {
"project_id": "<string>",
"days": 123,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 123,
"truncated_test_case_ids": [
"<string>"
]
}
}{
"error": "<string>",
"unknown_fields": [
"<string>"
],
"allowed_fields": [
"<string>"
]
}{
"error": "<string>"
}Analytics
Test-case execution history (batch)
Returns per-test-case execution history for the requested test cases, plus echoed query metadata.
POST
/
api
/
v2
/
analytics
/
test-case-history
/
batch
Test-case execution history (batch)
curl --request POST \
--url https://api.empirical.run/api/v2/analytics/test-case-history/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"test_case_ids": [
"<string>"
],
"project_id": 2,
"days": 45,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 500
}
'import requests
url = "https://api.empirical.run/api/v2/analytics/test-case-history/batch"
payload = {
"test_case_ids": ["<string>"],
"project_id": 2,
"days": 45,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 500
}
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({
test_case_ids: ['<string>'],
project_id: 2,
days: 45,
start_date: '<string>',
end_date: '<string>',
environment_id: '<string>',
limit_per_test_case: 500
})
};
fetch('https://api.empirical.run/api/v2/analytics/test-case-history/batch', 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.empirical.run/api/v2/analytics/test-case-history/batch",
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([
'test_case_ids' => [
'<string>'
],
'project_id' => 2,
'days' => 45,
'start_date' => '<string>',
'end_date' => '<string>',
'environment_id' => '<string>',
'limit_per_test_case' => 500
]),
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.empirical.run/api/v2/analytics/test-case-history/batch"
payload := strings.NewReader("{\n \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\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.empirical.run/api/v2/analytics/test-case-history/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/v2/analytics/test-case-history/batch")
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 \"test_case_ids\": [\n \"<string>\"\n ],\n \"project_id\": 2,\n \"days\": 45,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"environment_id\": \"<string>\",\n \"limit_per_test_case\": 500\n}"
response = http.request(request)
puts response.read_body{
"data": {
"history_by_test_case_id": {}
},
"meta": {
"project_id": "<string>",
"days": 123,
"start_date": "<string>",
"end_date": "<string>",
"environment_id": "<string>",
"limit_per_test_case": 123,
"truncated_test_case_ids": [
"<string>"
]
}
}{
"error": "<string>",
"unknown_fields": [
"<string>"
],
"allowed_fields": [
"<string>"
]
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Test case IDs to fetch history for (non-empty).
Minimum array length:
1Project ID (ignored; the project comes from auth scope).
Required range:
x >= 1Number of days of history (1-90, default 30). Ignored when start_date and end_date are set.
Required range:
1 <= x <= 90Start of a custom date range (ISO 8601).
End of a custom date range (ISO 8601).
Filter by environment ID.
Maximum history entries returned per test case (1-1000, default 50).
Required range:
1 <= x <= 1000Was this page helpful?
⌘I