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
オーディエンスを削除
Instagram 広告アカウントのカスタムオーディエンスを ID で完全削除します。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"
}