Get the Latest Log Entries - Cognigy Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the Latest Log Entries
GET /v2.0/projects/{projectId}/logs/tail
cURL
curl --request GET \
--url https://api-trial.cognigy.ai/new/v2.0/projects/{projectId}/logs/tail \
--header 'X-API-Key: <api-key>'
Python
import requests
url = "https://api-trial.cognigy.ai/new/v2.0/projects/{projectId}/logs/tail"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api-trial.cognigy.ai/new/v2.0/projects/{projectId}/logs/tail', 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/new/v2.0/projects/{projectId}/logs/tail",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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/new/v2.0/projects/{projectId}/logs/tail"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Responses
Success Response (200)
{
"items": [
{
"_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"msg": "<string>",
"meta": {},
"traceId": "<string>"
}
],
"total": 1,
"nextCursor": "<string>",
"previousCursor": "<string>"
}
Error Response (400)
{
"status": 123,
"code": 123,
"type": "<string>",
"detail": "The provided cursor value is invalid."
}
Authorizations
X-API-Key
- Type: string
- In: header
- Required: true
Required Headers
- Accept
- Type: enum
- Values:
application/json,application/hal+json,application/xml,text/xml,text/csv
- Type: enum
Path Parameters
- projectId
- Type: string
- Required: true
- Format: Required string length:
24 - Pattern:
^[a-z0-9]{24}$
Query Parameters
next
- Type: string
- Required: false
- Description: The cursor that points to the next page of results.
previous
- Type: string
- Required: false
- Description: The cursor that points to the previous page of results.
type
- Type: enum
[] - Values:
fatal,error,warn,info,debug,trace
- Type: enum
userId
- Type: string
- Required: false
flowName
- Type: string
- Required: false