curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003", {
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'}
r = requests.delete('https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003', headers=headers)
print(r.json())
{
"status": "success",
"id": "8c1e2f3a-0000-4000-8000-000000000101",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 8c1e2f3a-0000-4000-8000-000000000101 is not an audience of ad account 5a0d1b2c-0000-4000-8000-000000000003."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Snapchat's reason"
}
Snapchat Ads
刪除受眾
依 ID 永久刪除 Snapchat 廣告帳戶中的受眾區隔,包括在 Ads Manager 中建立的區隔。
DELETE
/
ads
/
snapchat
/
audiences
/
{id}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003", {
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'}
r = requests.delete('https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003', headers=headers)
print(r.json())
{
"status": "success",
"id": "8c1e2f3a-0000-4000-8000-000000000101",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 8c1e2f3a-0000-4000-8000-000000000101 is not an audience of ad account 5a0d1b2c-0000-4000-8000-000000000003."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Snapchat's reason"
}
從 Snapchat 廣告帳戶中刪除受眾區隔。此操作無法復原:該區隔也會從 Ads Manager 中消失,鎖定它的投放中廣告將不再觸及這些人。
accountId指定的廣告帳戶上的任何區隔都可以刪除,包括在 Ads Manager 中建立的區隔。其他廣告帳戶的區隔,或已刪除或未知的 ID,會回傳帶有code: 101的400,且不會刪除任何內容。
請求頭參數
路徑參數
區隔 ID,來自受眾。
查詢參數
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003", {
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'}
r = requests.delete('https://api.ayrshare.com/api/ads/snapchat/audiences/8c1e2f3a-0000-4000-8000-000000000101?accountId=5a0d1b2c-0000-4000-8000-000000000003', headers=headers)
print(r.json())
{
"status": "success",
"id": "8c1e2f3a-0000-4000-8000-000000000101",
"deleted": true
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 8c1e2f3a-0000-4000-8000-000000000101 is not an audience of ad account 5a0d1b2c-0000-4000-8000-000000000003."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Snapchat's reason"
}