curl --request POST \
--url https://api.zelto.ai/v1/conversations/{id}/customer-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"score": 50,
"note": "<string>",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>"
}
'import requests
url = "https://api.zelto.ai/v1/conversations/{id}/customer-metrics"
payload = {
"label": "<string>",
"score": 50,
"note": "<string>",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>"
}
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({
label: '<string>',
score: 50,
note: '<string>',
metricId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>'
})
};
fetch('https://api.zelto.ai/v1/conversations/{id}/customer-metrics', 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.zelto.ai/v1/conversations/{id}/customer-metrics",
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([
'label' => '<string>',
'score' => 50,
'note' => '<string>',
'metricId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'externalId' => '<string>'
]),
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.zelto.ai/v1/conversations/{id}/customer-metrics"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\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.zelto.ai/v1/conversations/{id}/customer-metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zelto.ai/v1/conversations/{id}/customer-metrics")
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 \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"source": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"verdict": "pass",
"score": 123,
"note": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Enviar una métrica de cliente
Crear o reemplazar una métrica proporcionada por el cliente para una llamada. verdict (aprobación/falla) y/o score (0100), y opcionalmente asignarlo a una de sus métricas de Zelto con metricId. Idempotente en (conversation, label): reenviar el mismo label Reemplaza el valor anterior. Requiere que las métricas estén habilitadas para la organización.
curl --request POST \
--url https://api.zelto.ai/v1/conversations/{id}/customer-metrics \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"score": 50,
"note": "<string>",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>"
}
'import requests
url = "https://api.zelto.ai/v1/conversations/{id}/customer-metrics"
payload = {
"label": "<string>",
"score": 50,
"note": "<string>",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>"
}
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({
label: '<string>',
score: 50,
note: '<string>',
metricId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
externalId: '<string>'
})
};
fetch('https://api.zelto.ai/v1/conversations/{id}/customer-metrics', 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.zelto.ai/v1/conversations/{id}/customer-metrics",
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([
'label' => '<string>',
'score' => 50,
'note' => '<string>',
'metricId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'externalId' => '<string>'
]),
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.zelto.ai/v1/conversations/{id}/customer-metrics"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\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.zelto.ai/v1/conversations/{id}/customer-metrics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zelto.ai/v1/conversations/{id}/customer-metrics")
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 \"label\": \"<string>\",\n \"score\": 50,\n \"note\": \"<string>\",\n \"metricId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"externalId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"label": "<string>",
"source": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"metricId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalId": "<string>",
"verdict": "pass",
"score": 123,
"note": "<string>"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Autorizaciones
Envía Authorization: Bearer YOUR_API_KEY. La clave corresponde a una sola organización.
Parámetros de ruta
Cuerpo
Proveer al menos una de verdict o score.
El nombre del cliente para esta métrica, por ejemplo, "Comprobación de cumplimiento".
1 - 255pass, fail 0 <= x <= 1005000Asigna esta métrica de cliente a una de tus métricas de Zelto en el agente de la llamada.
Su propia identidad para este disco.
255Respuesta
La métrica de cliente creada (o reemplazada).
El nombre del cliente para la métrica, por ejemplo, "Comprobación de cumplimiento".
Procedencia del registro, p. ej. api.
La métrica de Zelto esta métrica de cliente se asigna a, si la hay.
El ID del cliente para este registro.
pass, fail - Nulo cuando solo se envió un veredicto de aprobación/fallo.

