API pro affiliate partnery › Autorizace Získat poslední novinku GET /api/crm/v2/application.get_last_news_itemv2
operationId: application.getLastNewsItem
Vrací poslední nepřečtenou novinku pro aktuálního uživatele, aby byla zobrazena v popup okně. Po odpovědi je novinka označena jako zobrazená, aby se již znovu nezobrazovala.
Autorizace api-token + language + role
Odpovědi 200
object
status string povinné
Hodnoty: successerror
Příklad: success
data array of object povinné
id number povinné
Příklad: 1
date_publication string povinné
Příklad: 2023-12-28 21:57:50
title string povinné
Příklad: Test: Boys next door
content string povinné
Příklad: <b>Best regards, the FoodSoul team!</b>
section string povinné
Příklad: news
curl PHP JavaScript Python Kopírovat
curl -X GET 'https://foodsoul.ru/api/crm/v2/application.get_last_news_item' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: cs' \
-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' => 'cs' ,
'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" : "cs" ,
"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" : "cs" ,
"role" : "affiliate" ,
},
)
data = response . json () Odpověď 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"
}
]
} Žádosti jsou odesílány na foodsoul.ru — to je hostitel tohoto portálu, jiný vybrat nelze.