API dla afiliantów › Wsparcie Pobierz czat z autorem zgłoszenia POST /api/crm/v2/tickets.get_chat_customerv2
operationId: tickets.getChatCustomer
Zwraca wiadomości otwartego czatu z autorem zgłoszenia (hidden=false): autor, tekst, linki do załączników oraz reply_id — ID wiadomości, na którą udzielono odpowiedzi.
Autoryzacja api-token + language + role
Treść żądania application/json object
id integer wymagane
Przykład: 394
Odpowiedzi 200
object
status string wymagane
Wartości: successerror
Przykład: success
data object
messages array of object
id integer wymagane
Przykład: 880
date string (DataTimeFormatSQL) wymagane
Przykład: 2024-05-02 08:31:16
user_id integer
Przykład: 632
message string
Przykład: Hello World
reply_id integer
Przykład: 879
hidden boolean wymagane
Przykład: false
user_name string
Przykład: User Name
affiliate_name string
Przykład: user name
files array of object
file_id string wymagane
Przykład: df9a0531a9da6cf027e5143f38486dba
link string wymagane
Przykład: https://cdn.foodsoul.pro/support/407/images/df9a0531a9da6cf027e5143f38486dba.jpg?v1733409704
curl PHP JavaScript Python Kopiuj
curl -X POST 'https://foodsoul.pro/api/crm/v2/tickets.get_chat_customer' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: pl' \
-H 'role: affiliate' \
-H 'Content-Type: application/json' \
-d '{"id":394}' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'POST' , 'https://foodsoul.pro/api/crm/v2/tickets.get_chat_customer' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'pl' ,
'role' => 'affiliate' ,
],
'json' => [
'id' => 394 ,
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.pro/api/crm/v2/tickets.get_chat_customer" , {
method : "POST" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "pl" ,
"role" : "affiliate" ,
"Content-Type" : "application/json"
},
body : JSON . stringify ({
"id" : 394
}),
})
const data = await response . json () import requests
response = requests . request (
"POST" ,
"https://foodsoul.pro/api/crm/v2/tickets.get_chat_customer" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "pl" ,
"role" : "affiliate" ,
},
json ={
"id" : 394 ,
},
)
data = response . json () Odpowiedź 200
{
"status" : "success" ,
"data" : {
"messages" : [
{
"id" : 880 ,
"date" : "2024-05-02 08:31:16" ,
"user_id" : 632 ,
"message" : "Hello World" ,
"reply_id" : 879 ,
"hidden" : false ,
"user_name" : "User Name" ,
"affiliate_name" : "user name" ,
"files" : [
{
"file_id" : "df9a0531a9da6cf027e5143f38486dba" ,
"link" : "https://cdn.foodsoul.pro/support/407/images/df9a0531a9da6cf027e5143f38486dba.jpg?v1733409704"
}
]
}
]
}
} Żądania są wysyłane na foodsoul.pro — to jest host tego portalu, nie można wybrać innego.