İçeriğe geç
Uygulamayı yükle
Türkçe

[POST] Stoğa girdi e-postası gönderme

Yapay Zekâ Özeti

Bir veya daha fazla stoğa girince haber ver gönderimine tek istekte stok yenileme e-postası gönderen uç noktayı belgeler.

  • Zorunlu ids dizisiyle POST /shop-api/back-in-stock/send-notify-restock çağırın; hız sınırı throttle:30,1'dir.
  • Daha önce e-posta gönderilmiş gönderimlere yeniden göndermek için allow_resend değerini true yapın.
  • Yanıt sent_count, sent_ids ve skipped_ids değerlerini listeler (zaten gönderilmiş, abonelikten çıkmış, e-postası yok veya sınır).
  • E-posta sınırına ulaşıldığında "Daily or monthly email limit reached" hatasıyla başarısız olur.

Yapay zekâ tarafından oluşturulan özet. Hata içerebilir; aşağıdaki kılavuzun tamamını kontrol edin.

Aynı istekte tek bir kayıt veya birden fazla kayıt için stoğa girdi e-postası gönderebilirsiniz.

* Kimlik doğrulama

Zorunlu Authorization

Sınır throttle:30,1

İstek

Uç nokta POST - /shop-api/back-in-stock/send-notify-restock

Payload gövdesi

allow_resend true olduğunda, listedeki kimliklere ait olup stoğa girdi e-postası zaten gönderilmiş kayıtlara e-posta yeniden gönderilir.

Parametreler Tür Zorunlu
ids array yes
allow_resend sometimes|boolean option
POST /shop-api/back-in-stock/send-notify-restock HTTP/1.1
Host: preorder.globo.io
Content-Type: application/json
Authorization: ************
Content-Length: 49
{
"ids": [1,2,3],
"allow_resend": false
}
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "************");
const raw = JSON.stringify({
"ids": [1,2,3],
"allow_resend": false
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/back-in-stock/send-notify-restock", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://preorder.globo.io/shop-api/back-in-stock/send-notify-restock',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"ids": [1,2,3],
"allow_resend": false
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Başarılı yanıt 200

{
"success": true,
"message": "Restock notification sent successfully",
"data": {
"sent_count": 2, // total submission sent
"sent_ids": [12345, 12346], // IDs submission sent
"skipped_ids": [12347], // IDs submission skipped (submission sent + allow_resend=false, unsubscribe, no email, limit...)
"allow_resend": false
}
}

Başarısız

// Not found submission
{ "success": false, "message": "Not found submissions to send", "data": { "sent_count": 0, "skipped_ids": [12345] } }
// reach to limit 
{ "success": false, "message": "Daily or monthly email limit reached" }
// id submission required
{ "success": false, "message": "The ids field is required." }
// catch
{ "success": false, "message": "Something went wrong" }

Bu sayfa yardımcı oldu mu?

Sorun bildir