curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/facebook/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/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/facebook/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"
}
Facebook Ads
Видалити аудиторію
Остаточно видаліть за ID користувацьку аудиторію рекламного акаунта Facebook, зокрема з Ads Manager. Спершу видаліть схожі аудиторії на її основі.
DELETE
/
ads
/
facebook
/
audiences
/
{id}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/facebook/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/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/facebook/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"
}
Видаляє користувацьку аудиторію з рекламного акаунта Facebook. Це остаточно: аудиторія зникає й з Ads Manager, а будь-яка активна реклама, що на неї таргетується, перестає охоплювати цих людей.
- Аудиторію, на основі якої побудовано схожі аудиторії, видалити не можна. Спочатку видаліть ці схожі аудиторії.
- Можна видалити будь-яку користувацьку аудиторію рекламного акаунта, указаного в
accountId, зокрема створену в Ads Manager. Будь-який інший ідентифікатор повертає400зcode: 101.
Параметри заголовка
Параметри шляху
Ідентифікатор аудиторії з Аудиторій.
Параметри запиту
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/facebook/audiences/23851234567890123?accountId=1234567890"
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/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/facebook/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"
}