Salta ai contenuti
Installa l’app
Italiano

[POST] Invia e-mail di rifornimento

Panoramica AI

Documenta l'endpoint che invia le email di riassortimento a una o più iscrizioni di disponibilità in un'unica richiesta.

  • Chiami POST /shop-api/back-in-stock/send-notify-restock con un array ids obbligatorio; il limite di frequenza è throttle:30,1.
  • Imposti allow_resend su true per inviare di nuovo alle iscrizioni che hanno già ricevuto l'email.
  • La risposta elenca sent_count, sent_ids e skipped_ids (già inviato, disiscritto, senza email o limite raggiunto).
  • Fallisce con "Daily or monthly email limit reached" quando viene raggiunto il limite di email.

Riepilogo generato dall’AI. Può contenere errori, quindi controlla la guida completa qui sotto.

È possibile inviare l’e-mail di rifornimento per una o più iscrizioni nella stessa richiesta.

* Authentication

Obbligatorio Authorization

Limite throttle:30,1

Richiesta

Endpoint POST - /shop-api/back-in-stock/send-notify-restock

Corpo del payload

Quando allow_resend è true, le iscrizioni a cui è già stata inviata l’e-mail di rifornimento e che si trovano nell’elenco degli ID verranno inviate nuovamente.

Parametri Tipo Obbligatorio
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;

Risposta di successo 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
}
}

Errore

// 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" }

Questa pagina ti è stata utile?

Segnala un problema