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
Boost डेलिगेशन बनाएँ
अपने खाते की एक प्रोफ़ाइल, यानी payer, को उसके विज्ञापन खाते से अन्य प्रोफ़ाइलों की पोस्ट boost करने दें। अनुरोध 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."
}
boost डेलिगेशन आपके खाते की एक प्रोफ़ाइल, यानी payer, को उन पोस्ट को boost करने देता है जिन्हें आपके खाते की अन्य प्रोफ़ाइलों ने प्रकाशित किया है। payer वह प्रोफ़ाइल है जिसका विज्ञापन खाता विज्ञापन के लिए भुगतान करता है।
डेलिगेशन आपके Primary Profile की API Key से प्रबंधित किए जाते हैं। अनुरोध
प्रोफ़ाइलों की पहचान उस
Profile-Key के बिना भेजें।
हेडर पैरामीटर
बॉडी पैरामीटर
वे User Profiles (यूज़र प्रोफ़ाइल) जिनकी पोस्ट payer boost कर सकता है। या तो
refId वाले अधिकतम 1,000 ऑब्जेक्ट की सूची, या payer को छोड़कर आज आपके खाते की हर User Profile के लिए "all"। आपका Primary Profile owner नहीं हो सकता।1,000 की सीमा "all" पर भी लागू होती है: यदि आपके खाते में payer के अलावा 1,000 से अधिक User Profiles हैं, तो अनुरोध code 101 के साथ अस्वीकार कर दिया जाता है और कुछ भी नहीं बनाया जाता। इसके बजाय owners को प्रति अनुरोध अधिकतम 1,000 प्रोफ़ाइलों की सूचियों के रूप में भेजें।"all" उन प्रोफ़ाइलों को शामिल नहीं करता जिन्हें आप बाद में बनाते हैं। उन्हें जोड़ने के लिए अनुरोध दोबारा भेजें।भुगतान करने वाली प्रोफ़ाइल,
refId वाले ऑब्जेक्ट के रूप में। अपने Primary Profile का उपयोग करने के लिए इसे छोड़ दें।डेलिगेट किए जाने वाले विज्ञापन प्लेटफ़ॉर्म, उदाहरण के लिए
["instagram"]। केवल वे नेटवर्क स्वीकार किए जाते हैं जो किसी और की ओर से बूस्ट करना सपोर्ट करते हैं; कोई अन्य नेटवर्क 101 लौटाता है। आपको प्रत्येक owner और
प्लेटफ़ॉर्म के लिए एक डेलिगेशन मिलता है।refId से होती है जो प्रोफ़ाइल बनाते या प्रोफ़ाइलें प्राप्त करते समय लौटाई जाती है।
प्रत्येक owner और प्लेटफ़ॉर्म को अपना अलग डेलिगेशन मिलता है, जिसकी अपनी id होती है। अनुरोध दोबारा भेजने पर केवल वही डेलिगेशन बनते हैं जो मौजूद नहीं हैं, और मौजूदा डेलिगेशन बिना बदलाव के लौटाए जाते हैं। एक अपवाद: यदि owner ने नेटवर्क पर अनुमति अस्वीकार कर दी थी, तो डेलिगेशन की permission वापस unknown हो जाती है, ताकि अगला boost फिर से अनुमति माँगे। owner द्वारा खाता दोबारा लिंक करने के बाद अनुरोध भेजें। इस अनुरोध में शामिल किसी owner और प्लेटफ़ॉर्म का रद्द किया गया डेलिगेशन उसी id के साथ फिर से सक्रिय हो जाता है; owner के अन्य रद्द किए गए प्लेटफ़ॉर्म रद्द ही रहते हैं।
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."
}