API za afilijate › Ауторизација Dobij najnoviju vest GET /api/crm/v2/application.get_last_news_itemv2
operationId: application.getLastNewsItem
Враћа последњу непрочитану вест за тренутног корисника, како би се приказала у искачућем прозору. Након одговора, вест се означава као приказана, тако да се не појављује поново.
Ауторизација api-token + language + role
Одговори 200
object
status string обавезно
Vrednosti: successerror
Пример: success
data array of object обавезно
id number обавезно
Пример: 1
date_publication string обавезно
Пример: 2023-12-28 21:57:50
title string обавезно
Пример: Test: Boys next door
content string обавезно
Текст vesti u HTML formatu
Пример: <b>Best regards, the FoodSoul team!</b>
section string обавезно
Пример: news
curl PHP JavaScript Python Копирај
curl -X GET 'https://foodsoul.ru/api/crm/v2/application.get_last_news_item' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: sr' \
-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' => 'sr' ,
'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" : "sr" ,
"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" : "sr" ,
"role" : "affiliate" ,
},
)
data = response . json () Одговор 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"
}
]
} Zahtevi se šalju na foodsoul.ru — ovo je host ovog portala, nije moguće izabrati drugi.