Exportar chat de una solicitud
curl --request GET \
--url https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}', 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.pruff.com/api/clients/chat/export/{requestType}/{requestId}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}"
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))
}HttpResponse<String> response = Unirest.get("https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"timestamp": 1752852433242,
"userId": 1,
"text": "Texto ejemplo",
"userName": "Ana Pérez",
"userEmail": "ana.perez@example.com",
"userRole": "Administrador"
},
{
"timestamp": 1752852430526,
"userId": 2,
"text": "Respuesta ejemplo",
"userName": "Carlos Soto",
"userEmail": "carlos.soto@example.com",
"userRole": "Gerente Operaciones"
}
]
}Chat
Exportar chat de una solicitud
Exporta el historial de mensajes del chat de una solicitud, con el nombre, el email y el rol de quien escribió cada mensaje. Los mensajes vienen del más reciente al más antiguo. Si la solicitud no tiene mensajes, messages viene vacío.
Los mensajes eliminados desde Pruff no se exportan.
Si el autor de un mensaje no tiene roles o ya no existe en Pruff, el mensaje se exporta igual: userRole viene como Sin rol y, si el usuario no existe, userName como Desconocido y userEmail como Sin email.
GET
/
chat
/
export
/
{requestType}
/
{requestId}
Exportar chat de una solicitud
curl --request GET \
--url https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}', 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.pruff.com/api/clients/chat/export/{requestType}/{requestId}",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}"
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))
}HttpResponse<String> response = Unirest.get("https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/chat/export/{requestType}/{requestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"timestamp": 1752852433242,
"userId": 1,
"text": "Texto ejemplo",
"userName": "Ana Pérez",
"userEmail": "ana.perez@example.com",
"userRole": "Administrador"
},
{
"timestamp": 1752852430526,
"userId": 2,
"text": "Respuesta ejemplo",
"userName": "Carlos Soto",
"userEmail": "carlos.soto@example.com",
"userRole": "Gerente Operaciones"
}
]
}