curl --request POST \
--url https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"message": "Mensaje de ejemplo"
}
'import requests
url = "https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}"
payload = { "message": "Mensaje de ejemplo" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Mensaje de ejemplo'})
};
fetch('https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}', 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/send/{requestType}/{requestId}/{email}",
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([
'message' => 'Mensaje de ejemplo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}"
payload := strings.NewReader("{\n \"message\": \"Mensaje de ejemplo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Mensaje de ejemplo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Mensaje de ejemplo\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Mensaje enviado exitosamente."
}Enviar mensaje al chat de una solicitud
Publica un mensaje en el chat de una solicitud, a nombre del usuario cuyo email va en la URL. Usa el email de un usuario activo de tu empresa que tenga al menos un rol asignado en Pruff. Los demás participantes de la solicitud reciben una notificación.
Para mencionar a un usuario escribe @[Nombre](id) dentro del texto, con el id del usuario en Pruff, y para mencionar a todos los participantes escribe @[todos](all). Los usuarios mencionados que participan en la solicitud reciben además una notificación y un correo; quien envía el mensaje no se notifica a sí mismo.
Si requestId no corresponde a una solicitud existente del tipo indicado, responde 404 y el mensaje no se guarda. Una solicitud borrada de tipo factoring, verification, creditLine, confirming, creditRequest, leasing o resellNominee cuenta como inexistente y responde el mismo 404.
curl --request POST \
--url https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"message": "Mensaje de ejemplo"
}
'import requests
url = "https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}"
payload = { "message": "Mensaje de ejemplo" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'Mensaje de ejemplo'})
};
fetch('https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}', 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/send/{requestType}/{requestId}/{email}",
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([
'message' => 'Mensaje de ejemplo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}"
payload := strings.NewReader("{\n \"message\": \"Mensaje de ejemplo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"Mensaje de ejemplo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pruff.com/api/clients/chat/send/{requestType}/{requestId}/{email}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"Mensaje de ejemplo\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Mensaje enviado exitosamente."
}