curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/delegations \
-d '{"owners": [{"refId": "140b8709bd6ade099b242d895e268fb886130c53"}], "platforms": ["instagram"]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/delegations", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
owners: [{ refId: "140b8709bd6ade099b242d895e268fb886130c53" }],
platforms: ["instagram"]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
{
"status": "success",
"delegations": [
{
"id": "Kx3v9QpL2mZ7tR1wYb4N",
"owner": { "refId": "140b8709bd6ade099b242d895e268fb886130c53", "title": "Agent One" },
"payer": { "refId": "9f1c3e7a2b4d", "title": "Agency" },
"platform": "instagram",
"permission": "unknown",
"status": "active"
}
]
}
{
"action": "ads",
"status": "error",
"code": 400,
"message": "These owner profiles are not found in this account: 140b8709bd6ade."
}
Boost on Behalf
ブースト委任を作成
支払者のプロフィールが自身の広告アカウントで他のプロフィールの投稿をブーストできるようにします。Primary Profile の API Key で送信。
POST
/
ads
/
delegations
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/delegations \
-d '{"owners": [{"refId": "140b8709bd6ade099b242d895e268fb886130c53"}], "platforms": ["instagram"]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/delegations", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
owners: [{ refId: "140b8709bd6ade099b242d895e268fb886130c53" }],
platforms: ["instagram"]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
{
"status": "success",
"delegations": [
{
"id": "Kx3v9QpL2mZ7tR1wYb4N",
"owner": { "refId": "140b8709bd6ade099b242d895e268fb886130c53", "title": "Agent One" },
"payer": { "refId": "9f1c3e7a2b4d", "title": "Agency" },
"platform": "instagram",
"permission": "unknown",
"status": "active"
}
]
}
{
"action": "ads",
"status": "error",
"code": 400,
"message": "These owner profiles are not found in this account: 140b8709bd6ade."
}
ブースト委任を使用すると、アカウント内の1つのプロフィール(支払者)が、アカウント内の他のプロフィールが公開した投稿をブーストできます。支払者とは、その広告アカウントで広告費用を支払うプロフィールです。
委任は Primary Profile(プライマリープロフィール)の API Key で管理します。リクエストは
プロフィールは、プロフィールの作成またはプロフィールの取得時に返される
Profile-Key を付けずに送信してください。
ヘッダーパラメータ
ボディパラメータ
支払者が投稿をブーストできる User Profile(ユーザープロフィール)。
refId を持つオブジェクトを最大1,000件含むリスト、または支払者を除く現時点でアカウント内にあるすべての User Profile を表す "all" のいずれかを指定します。Primary Profile をオーナーにすることはできません。1,000件の上限は "all" にも適用されます。支払者以外の User Profile がアカウント内に1,000件を超えて存在する場合、リクエストは code 101 で拒否され、何も作成されません。その場合は、1回のリクエストにつき最大1,000件のプロフィールのリストとして owners を送信してください。"all" には、後から作成したプロフィールは含まれません。それらを追加するには、リクエストを再度送信してください。委任する広告プラットフォーム(例:
["instagram"])。代理ブーストに対応するネットワークのみ受け付けます。それ以外は 101 を返します。オーナーとプラットフォームの
組み合わせごとに1件の委任が作成されます。refId で指定します。
オーナーとプラットフォームの組み合わせごとに個別の委任が作成され、それぞれに固有の id が付与されます。リクエストを再度送信すると、不足している委任のみが作成され、既存の委任は変更されずに返されます。ただし例外が1つあります。オーナーがネットワーク上で権限を拒否した場合、その委任の permission は unknown に戻り、次回のブースト時に再度権限が求められます。オーナーがアカウントを再リンクした後にリクエストを送信してください。このリクエストに含まれるオーナーとプラットフォームの委任が取り消し済みの場合、その委任は同じ id のまま再び有効になります。そのオーナーの他のプラットフォームで取り消し済みの委任は、取り消されたままです。
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/delegations \
-d '{"owners": [{"refId": "140b8709bd6ade099b242d895e268fb886130c53"}], "platforms": ["instagram"]}'
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/delegations", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body: JSON.stringify({
owners: [{ refId: "140b8709bd6ade099b242d895e268fb886130c53" }],
platforms: ["instagram"]
})
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
{
"status": "success",
"delegations": [
{
"id": "Kx3v9QpL2mZ7tR1wYb4N",
"owner": { "refId": "140b8709bd6ade099b242d895e268fb886130c53", "title": "Agent One" },
"payer": { "refId": "9f1c3e7a2b4d", "title": "Agency" },
"platform": "instagram",
"permission": "unknown",
"status": "active"
}
]
}
{
"action": "ads",
"status": "error",
"code": 400,
"message": "These owner profiles are not found in this account: 140b8709bd6ade."
}