Afilliatlar üçün API › Avtorizasiya Son xəbəri əldə et GET /api/crm/v2/application.get_last_news_itemv2
operationId: application.getLastNewsItem
Son istifadəçi üçün ən son oxunmamış xəbəri qaytarır, onu pop-up pəncərəsində göstərmək üçün. Cavabdan sonra xəbər göstərilmiş kimi işarələnir və təkrar göstərilmir.
Avtorizasiya api-token + language + role
Cavablar 200
object
status string mütləq
Dəyərlər: successerror
Nümunə: success
data array of object mütləq
date_publication string mütləq
Nümunə: 2023-12-28 21:57:50
title string mütləq
Nümunə: Test: Boys next door
content string mütləq
Xəbər mətninin HTML formatında versiyası
Nümunə: <b>Best regards, the FoodSoul team!</b>
section string mütləq
Nümunə: news
curl PHP JavaScript Python Kopyalamaq
curl -X GET 'https://foodsoul.pro/api/crm/v2/application.get_last_news_item' \
-H 'Authorization: Bearer fs_api_YOUR_TOKEN' \
-H 'language: az' \
-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' => 'az' ,
'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" : "az" ,
"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" : "az" ,
"role" : "affiliate" ,
},
)
data = response . json () Cavab 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"
}
]
} Sorğular foodsoul.pro ünvanına göndərilir — bu portalın hostudur, başqa birini seçmək mümkün deyil.