API per affiliati › Autorizzazione Ottenere l'ultima notizia GET /api/crm/v2/application.get_last_news_itemv2
operationId: application.getLastNewsItem
Restituisce l'ultima notizia non letta per l'utente corrente, da mostrare in una finestra pop-up. Dopo la risposta, la notizia viene contrassegnata come visualizzata, in modo che non venga più mostrata.
Autorizzazione api-token + language + role
Risposte 200
object
status string obbligatorio
Valori: successerror
Esempio: success
data array of object obbligatorio
id number obbligatorio
Esempio: 1
date_publication string obbligatorio
Esempio: 2023-12-28 21:57:50
title string obbligatorio
Esempio: Test: Boys next door
content string obbligatorio
Testo della notizia in HTML
Esempio: <b>Best regards, the FoodSoul team!</b>
section string obbligatorio
Esempio: news
curl PHP JavaScript Python Copiare
curl -X GET 'https://foodsoul.ru/api/crm/v2/application.get_last_news_item' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: it' \
-H 'role: affiliate' <?php
$client = new \GuzzleHttp\Client ();
$response = $client -> request ( 'GET' , 'https://foodsoul.ru/api/crm/v2/application.get_last_news_item' , [
'headers' => [
'Authorization' => 'Bearer fs_api_YOUR_TOKEN' ,
'language' => 'it' ,
'role' => 'affiliate' ,
],
]);
$data = json_decode (( string ) $response -> getBody (), true ); const response = await fetch ( "https://foodsoul.ru/api/crm/v2/application.get_last_news_item" , {
method : "GET" ,
headers : {
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "it" ,
"role" : "affiliate"
},
})
const data = await response . json () import requests
response = requests . request (
"GET" ,
"https://foodsoul.ru/api/crm/v2/application.get_last_news_item" ,
headers ={
"Authorization" : "Bearer fs_api_YOUR_TOKEN" ,
"language" : "it" ,
"role" : "affiliate" ,
},
)
data = response . json () Risposta 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"
}
]
} Le richieste vengono inviate a foodsoul.ru, che è l’host di questo portale; non è possibile sceglierne un altro.