Get success rate trend data - Cognigy Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get success rate trend data
Endpoint: GET /dashboard/success-rate-trend
cURL:
curl --request GET \
--url 'https://api-trial.cognigy.ai/testing/dashboard/success-rate-trend?timeWindow=7d' \
--header 'Authorization: Bearer <token>'
Python:
import requests
url = "https://api-trial.cognigy.ai/testing/dashboard/success-rate-trend?timeWindow=7d"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch):
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-trial.cognigy.ai/testing/dashboard/success-rate-trend?timeWindow=7d', 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-trial.cognigy.ai/testing/dashboard/success-rate-trend?timeWindow=7d",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Go:
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-trial.cognigy.ai/testing/dashboard/success-rate-trend?timeWindow=7d"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Response Status Codes:
200: Success400: Bad Request401: Unauthorized403: Forbidden500: Internal Server Error
Example Response
Success Response
{
"data": [
{
"date": "2024-01-15",
"totalRuns": 25,
"successfulRuns": 22,
"failedRuns": 3,
"successPercentage": 88
}
]
}
Error Response
{
"error": "<string>",
"field": "<string>",
"code": "<string>",
"traceId": "<string>"
}
Authorizations
- Authorization: JWT Bearer Token for authentication (required)
Query Parameters
- projectId: (string) required. Project identifier.
- scenarioIds: (string[]) Filter by scenario/simulation reference IDs (comma-separated or array). If not provided, includes all scenarios.
- timeWindow: (enum) Time window for data aggregation. Options:
7d,30d,3m(default:7d).
Response
200: application/json - Success rate trend data retrieved successfully.- data: (object[]) required. Array of daily trend data points.