Rerun Chat Analysis
curl --request POST \
--url https://api.talqing.com/v1/chats/{chat_id}/analysis \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/chats/{chat_id}/analysis"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/chats/{chat_id}/analysis', 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.talqing.com/v1/chats/{chat_id}/analysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/chats/{chat_id}/analysis"
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/chats/{chat_id}/analysis")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/chats/{chat_id}/analysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agent": {
"channel": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"analysis": {
"fields": {},
"outcome": "success",
"outcome_rationale": "<string>",
"skip_reason": "<string>",
"status": "none",
"summary": "<string>"
},
"close_reason": "<string>",
"contact_key": "<string>",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": {
"platform_fee": 123,
"provider_cost": 123,
"total_charge": 123,
"duration_s": 123
},
"created_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"started_at": "2023-11-07T05:31:56Z",
"status": "open",
"userdata": {}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}chats
Rerun Chat Analysis
Analyse an ended chat again with its agent’s saved definition.
A real model call: the workspace is charged and the chat re-priced.
POST
/
v1
/
chats
/
{chat_id}
/
analysis
Rerun Chat Analysis
curl --request POST \
--url https://api.talqing.com/v1/chats/{chat_id}/analysis \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.talqing.com/v1/chats/{chat_id}/analysis"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.talqing.com/v1/chats/{chat_id}/analysis', 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.talqing.com/v1/chats/{chat_id}/analysis",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.talqing.com/v1/chats/{chat_id}/analysis"
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.talqing.com/v1/chats/{chat_id}/analysis")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/chats/{chat_id}/analysis")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"agent": {
"channel": "<string>",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"analysis": {
"fields": {},
"outcome": "success",
"outcome_rationale": "<string>",
"skip_reason": "<string>",
"status": "none",
"summary": "<string>"
},
"close_reason": "<string>",
"contact_key": "<string>",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cost": {
"platform_fee": 123,
"provider_cost": 123,
"total_charge": 123,
"duration_s": 123
},
"created_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"started_at": "2023-11-07T05:31:56Z",
"status": "open",
"userdata": {}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
BearerAuthSessionCookie
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful Response
One chat: a text session from its first message to its end.
Show child attributes
Show child attributes
The analysis of one call, as every reader sees it.
Shared verbatim by the calls API and the session.completed webhook so an
integration that reads one can read the other.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Your own labels for this session, set by your inbound webhook.
Show child attributes
Show child attributes
Available options:
open, ended