콘텐츠로 이동
앱 설치
한국어

[POST] Send mail restock

AI 개요

한 번의 요청으로 재입고 알림 신청 한 건 이상에 재입고 이메일을 보내는 엔드포인트를 설명합니다.

  • 필수 ids 배열과 함께 POST /shop-api/back-in-stock/send-notify-restock을 호출합니다. 속도 제한은 throttle:30,1입니다.
  • 이미 이메일을 보낸 신청에 다시 보내려면 allow_resend를 true로 설정합니다.
  • 응답에는 sent_count, sent_ids, skipped_ids(이미 전송됨, 수신 거부, 이메일 없음 또는 한도 도달)가 나열됩니다.
  • 이메일 한도에 도달하면 "Daily or monthly email limit reached"와 함께 실패합니다.

AI가 생성한 요약입니다. 오류가 있을 수 있으니 아래 전체 가이드를 확인하세요.

하나의 요청으로 단일 또는 여러 신청에 대해 재입고 메일을 발송할 수 있습니다.

* 인증

필수 Authorization

제한 throttle:30,1

요청

엔드포인트 POST - /shop-api/back-in-stock/send-notify-restock

페이로드 본문

allow_resend가 true이면 목록 ID에서 이미 재입고 이메일이 발송된 신청에도 다시 발송됩니다.

매개변수 유형 필수
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;

성공 응답 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
}
}

실패

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

도움이 되었나요?

문제 신고