跳到內容
安裝應用程式
繁體中文

[DELETE] 刪除規則

AI 概覽

說明可在單一請求中刪除一條或多條即將推出規則的端點。

  • 使用 Authorization 標頭呼叫 DELETE /shop-api/coming-soon/delete;速率限制為 throttle:30,1。
  • 在請求本文中傳送 ids 陣列;此欄位為必填,最多可接受 100 個 ID。
  • 錯誤包括 «The ids field is required» 和 «Coming soon products not found»。

摘要由 AI 產生,可能有誤,請以下方完整指南為準。

您可以在同一個請求中刪除單筆或多筆即將上市規則。

* 驗證

必要 Authorization

限制 throttle:30,1

請求

端點 DELETE - /shop-api/coming-soon/delete

Payload 內容

參數 類型 必填
ids array yes max:100
DELETE /shop-api/coming-soon/delete HTTP/1.1
Host: preorder.globo.io
Content-Type: application/json
Authorization: ************
Content-Length: 21
{
"ids": [1324]
}
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "************");
const raw = JSON.stringify({
"ids": [
1324
]
});
const requestOptions = {
method: "DELETE",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://preorder.globo.io/shop-api/coming-soon/delete", 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/coming-soon/delete',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'{
"ids": [1324]
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ************'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

成功回應 200

{
"success": true,
"message": "Coming soon products deleted successfully"
}

失敗

// missing ids or ids is not array
{
"success": false,
"message": "The ids field is required"
}
// not found
{
"success": false,
"message": "Coming soon products not found"
}
// catch
{
"success": false,
"message": "Something went wrong"
}

這個頁面有幫助嗎?

回報問題