API pentru afiliați › Autorizare Obțineți ultima știre GET /api/crm/v2/application.get_last_news_itemv2
operationId: application.getLastNewsItem
Returnează ultima știre necitită pentru utilizatorul curent, pentru a fi afișată într-o fereastră pop-up. După răspuns, știrea este marcată ca afișată, astfel încât să nu mai apară din nou.
Autorizare api-token + language + role
Răspunsuri 200
object
status string obligatoriu
Valori: successerror
Exemplu: success
data array of object obligatoriu
id number obligatoriu
Exemplu: 1
date_publication string obligatoriu
Exemplu: 2023-12-28 21:57:50
title string obligatoriu
Exemplu: Test: Boys next door
content string obligatoriu
Exemplu: <b>Best regards, the FoodSoul team!</b>
section string obligatoriu
Exemplu: news
curl PHP JavaScript Python Copiază
curl -X GET 'https://foodsoul.pro/api/crm/v2/application.get_last_news_item' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: ro' \
-H 'role: affiliate' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'GET' , 'https://foodsoul.pro/api/crm/v2/application.get_last_news_item' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'ro' ,
'role' => 'affiliate' ,
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.pro/api/crm/v2/application.get_last_news_item" , {
method : "GET" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "ro" ,
"role" : "affiliate"
},
})
const data = await response . json () import requests
response = requests . request (
"GET" ,
"https://foodsoul.pro/api/crm/v2/application.get_last_news_item" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "ro" ,
"role" : "affiliate" ,
},
)
data = response . json () Răspuns 200
{
"status" : "success" ,
"data" : [
{
"id" : 1 ,
"date_publication" : "2023-12-28 21:57:50" ,
"title" : "Test: Boys next door" ,
"content" : "<b>Best regards, the FoodSoul team!</b>" ,
"section" : "news"
}
]
} Solicitările sunt trimise către foodsoul.pro — acesta este gazda acestui portal, nu se poate alege alta.