Aggiornamento Account Cliente
curl --request POST \
--url https://backend.trilly.chat/api/client/update \
--header 'Content-Type: application/json' \
--data '
{
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente"
}
'import requests
url = "https://backend.trilly.chat/api/client/update"
payload = {
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id_client: '12345', account_type: 'baby', nome_cliente: 'Nuovo Nome Cliente'})
};
fetch('https://backend.trilly.chat/api/client/update', 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://backend.trilly.chat/api/client/update",
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([
'id_client' => '12345',
'account_type' => 'baby',
'nome_cliente' => 'Nuovo Nome Cliente'
]),
CURLOPT_HTTPHEADER => [
"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://backend.trilly.chat/api/client/update"
payload := strings.NewReader("{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://backend.trilly.chat/api/client/update")
.header("Content-Type", "application/json")
.body("{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.trilly.chat/api/client/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}"
response = http.request(request)
puts response.read_body{
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente",
"user_name": "Nuovo Nome Utente"
}Partners
Aggiornamento Account Cliente
Questa chiamata consente ai partner di aggiornare la tipologia di account e/o il nome di un cliente associato al proprio Account Partner. L’API verifica che il cliente appartenga al partner tramite l’API Key. In caso di successo, la sessione del cliente verrà resettata solo se viene modificata la tipologia di account.
POST
/
api
/
client
/
update
Aggiornamento Account Cliente
curl --request POST \
--url https://backend.trilly.chat/api/client/update \
--header 'Content-Type: application/json' \
--data '
{
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente"
}
'import requests
url = "https://backend.trilly.chat/api/client/update"
payload = {
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id_client: '12345', account_type: 'baby', nome_cliente: 'Nuovo Nome Cliente'})
};
fetch('https://backend.trilly.chat/api/client/update', 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://backend.trilly.chat/api/client/update",
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([
'id_client' => '12345',
'account_type' => 'baby',
'nome_cliente' => 'Nuovo Nome Cliente'
]),
CURLOPT_HTTPHEADER => [
"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://backend.trilly.chat/api/client/update"
payload := strings.NewReader("{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://backend.trilly.chat/api/client/update")
.header("Content-Type", "application/json")
.body("{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.trilly.chat/api/client/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id_client\": \"12345\",\n \"account_type\": \"baby\",\n \"nome_cliente\": \"Nuovo Nome Cliente\"\n}"
response = http.request(request)
puts response.read_body{
"id_client": "12345",
"account_type": "baby",
"nome_cliente": "Nuovo Nome Cliente",
"user_name": "Nuovo Nome Utente"
}Query Parameters
API Key del Partner che effettua la richiesta.
Body
application/json
ID del cliente da aggiornare.
Tipologia di account.
test: 100 crediti e scadenza account dopo 14 giorni dalla creazione.baby: 2000 crediti a refill annuale.full: nessuna limitazione (account attuali).disable: l’account viene disattivato.
Available options:
test, baby, full, disable Nuovo nome del cliente. Se valorizzato, aggiorna anche il nome utente associato.

