curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
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/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"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": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}
Instagram Ads
刪除受眾
依 ID 永久刪除 Instagram 廣告帳戶中的自訂受眾,包括在 Ads Manager 中建立的受眾。請先刪除以它為基礎的類似受眾。
DELETE
/
ads
/
instagram
/
audiences
/
{id}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
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/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"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": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}
從 Instagram 廣告帳戶中刪除自訂受眾。此操作是永久性的:受眾也會從 Ads Manager 中消失,任何鎖定它的投放中廣告都將不再觸及這些人。
- 作為類似受眾基礎的受眾無法刪除。請先刪除這些類似受眾。
- 可以刪除
accountId指定之廣告帳戶上的任何自訂受眾,包括在 Ads Manager 中建立的受眾。任何其他 ID 都會傳回帶有code: 101的400。
請求頭參數
路徑參數
受眾 ID,來自受眾。
查詢參數
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/instagram/audiences/23851234567890123?accountId=1234567890", {
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/instagram/audiences/23851234567890123?accountId=1234567890', headers=headers)
print(r.json())
{
"status": "success",
"id": "23851234567890123",
"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": "This audience cannot be deleted while lookalike audiences are built on it. Delete those lookalikes first."
}
{
"action": "request",
"status": "error",
"code": 101,
"message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
"details": "id 23851234567890123 is not a custom audience of ad account 123456789."
}
{
"action": "ads",
"status": "error",
"code": 369,
"message": "Unable to delete the audience. Please try again.",
"details": "Meta's reason"
}