curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/automations/auto_9xKp2Lm4nQ
const API_KEY = "API_KEY";
const id = "auto_9xKp2Lm4nQ";
fetch(`https://api.ayrshare.com/api/automations/${id}`, {
method: "DELETE",
headers: { "Authorization": `Bearer ${API_KEY}` },
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {"Authorization": "Bearer API_KEY"}
automation_id = "auto_9xKp2Lm4nQ"
r = requests.delete(
f"https://api.ayrshare.com/api/automations/{automation_id}",
headers=headers,
)
print(r.json())
$id = "auto_9xKp2Lm4nQ";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/automations/" . $id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => ["Authorization: Bearer API_KEY"],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"status": "success",
"id": "auto_9xKp2Lm4nQ"
}
{
"action": "automation",
"status": "error",
"code": 469,
"message": "Automation not found"
}
Automations
删除自动化
软删除某个自动化
DELETE
/
automations
/
:id
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/automations/auto_9xKp2Lm4nQ
const API_KEY = "API_KEY";
const id = "auto_9xKp2Lm4nQ";
fetch(`https://api.ayrshare.com/api/automations/${id}`, {
method: "DELETE",
headers: { "Authorization": `Bearer ${API_KEY}` },
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {"Authorization": "Bearer API_KEY"}
automation_id = "auto_9xKp2Lm4nQ"
r = requests.delete(
f"https://api.ayrshare.com/api/automations/{automation_id}",
headers=headers,
)
print(r.json())
$id = "auto_9xKp2Lm4nQ";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/automations/" . $id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => ["Authorization: Bearer API_KEY"],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"status": "success",
"id": "auto_9xKp2Lm4nQ"
}
{
"action": "automation",
"status": "error",
"code": 469,
"message": "Automation not found"
}
Beta。 请参见自动化概述获取完整的功能描述。
deleted: true, active: false;从此不再产生新的派发。
已有的触发器、动作和活动条目不会级联删除。只要 Firestore 中的记录存在,活动历史就可继续通过 GET /automations/:id/activity 查询(出于追踪与分析目的,保留时间为无限期)。
被软删除的自动化不再计入你的活跃自动化上限。它们无法通过 API 恢复;请重新创建一个自动化。
请求头参数
路径参数
从
POST /automations 返回的自动化 ID。curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE https://api.ayrshare.com/api/automations/auto_9xKp2Lm4nQ
const API_KEY = "API_KEY";
const id = "auto_9xKp2Lm4nQ";
fetch(`https://api.ayrshare.com/api/automations/${id}`, {
method: "DELETE",
headers: { "Authorization": `Bearer ${API_KEY}` },
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {"Authorization": "Bearer API_KEY"}
automation_id = "auto_9xKp2Lm4nQ"
r = requests.delete(
f"https://api.ayrshare.com/api/automations/{automation_id}",
headers=headers,
)
print(r.json())
$id = "auto_9xKp2Lm4nQ";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/automations/" . $id,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => ["Authorization: Bearer API_KEY"],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
{
"status": "success",
"id": "auto_9xKp2Lm4nQ"
}
{
"action": "automation",
"status": "error",
"code": 469,
"message": "Automation not found"
}
⌘I
