API referansı · Mesajlar
Mesajı okundu işaretle
Bir mesajı StockMount'ta okundu olarak işaretler.
https://out.stockmount.com/api/Integration/SetMessageRead
Desteklenen entegrasyon N11'dir (IntegrationId 2). Mesaj yalnızca StockMount'ta okundu olarak işaretlenir; N11'e bir istek gönderilmez.
IntegrationId için 1 (GittiGidiyor) ve 2 (N11) dışındaki değerler 99999 döndürür ve ErrorMessage boş gelir.
İşaretlenecek mesajı UserMessageId ile belirtin. Mesaj bulunamasa da yanıt başarılıdır (Result: true); sonucu doğrulamak için GetUserMessages yanıtındaki Unread alanına bakın.
Başarılı yanıtta Response alanı gelmez.
İstek alanları
| Alan | Tip | Açıklama |
|---|---|---|
ApiCode
zorunlu
|
string |
DoLogin yanıtından aldığınız oturum kodu.
|
StoreId
zorunlu
|
integer | Mesajın ait olduğu mağazanın kimliği. |
IntegrationId
zorunlu
|
integer | Mağazanın entegrasyon kimliği. N11 için 2. |
UserMessageId
|
integer |
Okundu işaretlenecek mesajın UserMessageId değeri. Doğrulanmaz; gönderilmezse hiçbir mesaj değişmez ama yanıt yine başarılıdır.
|
Yanıt alanları (Response)
Başarılı çağrıda Response alanı boş döner; sonucu Result alanından okuyun.
Bu servisin hata kodları
| Kod | Ne zaman |
|---|---|
00003 |
StoreId veya IntegrationId eksik ya da 0. ErrorMessage alan adını içerir. |
99999 |
IntegrationId desteklenmiyor (1 ve 2 dışında; ErrorMessage boş) veya sunucu hatası oluştu. |
Oturum hataları (00001, 00006) ve tüm kodlar için hata kodları.
İlgili servisler
Örnek istek
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
}
curl -X POST 'https://out.stockmount.com/api/Integration/SetMessageRead' \
-H 'Content-Type: application/json' \
-d '{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
}'
using System.Net.Http;
using System.Text;
using var http = new HttpClient();
var json = """
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
}
""";
var response = await http.PostAsync(
"https://out.stockmount.com/api/Integration/SetMessageRead",
new StringContent(json, Encoding.UTF8, "application/json"));
var result = await response.Content.ReadAsStringAsync();
// Result == false ise ErrorCode ve ErrorMessage alanlarına bakın.
Console.WriteLine(result);
<?php
$body = <<<'JSON'
{
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
}
JSON;
$ch = curl_init('https://out.stockmount.com/api/Integration/SetMessageRead');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $body,
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!$result['Result']) {
echo $result['ErrorCode'] . ' ' . $result['ErrorMessage'];
}
import requests
payload = {
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
}
response = requests.post("https://out.stockmount.com/api/Integration/SetMessageRead", json=payload, timeout=60)
result = response.json()
if not result["Result"]:
print(result["ErrorCode"], result["ErrorMessage"])
const payload = {
"ApiCode": "API_CODE",
"StoreId": 1234,
"IntegrationId": 2,
"UserMessageId": 88119
};
const response = await fetch("https://out.stockmount.com/api/Integration/SetMessageRead", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
const result = await response.json();
if (!result.Result) {
console.error(result.ErrorCode, result.ErrorMessage);
}
Örnek yanıt
{
"Result": true
}
Deneyin
İstek tarayıcınızdan doğrudan out.stockmount.com adresine gider. ApiCode bu sitede saklanmaz; yalnızca bu sekme açıkken tutulur.
İstek göndermek için önce ApiCode alın.
Bu servis hesabınızdaki gerçek verileri değiştirir.
Son istekler
Bu sekmeden gönderdiğiniz son istekler; birine tıklayınca gövdesi yeniden yüklenir.