I met similar issue several times.
Below is success call
var createAdset_params = {
method: "post"
}
var url = "https://graph.facebook.com/v2.12/act_"+req.body.ADACCOUNT_ID+"/adsets?access_token="+req.body.access_token +
"&name=My+Reach+Ad+Set"+
"&optimization_goal=REACH"+
"&billing_event=IMPRESSIONS"+
"&bid_amount=2"+
"&daily_budget=1000"+
"&campaign_id="+req.body.CAMPAIGN_ID+
"&targeting=%7B%22geo_locations%22%3A%7B%22countries%22%3A%5B%22US%22%5D%7D%7D"+
"&status=PAUSED"+
"&promoted_object%3A%20%7B"+
"page_id%3A%20%"+req.body.PAGE_ID+"%22%7D";
request({url:url, qs: createAdset_params}, function(err, response, body) {
if(err) {
console.log(err); return;
}
console.log("create adset result", body);
res.send(body);
});
Create ad set and return id of adset.
Below is not success call.
var createAdset_params = {
method: "post"
name:"My Reach Ad Set",
promoted_object: {page_id: req.body.PAGE_ID},
optimization_goal: "REACH",
billing_event:"IMPRESSIONS",
bid_amount:2,
daily_budget:1000,
campaign_id:req.body.CAMPAIGN_ID,
status: "PAUSED",
targeting:{
geo_locations: {countries:["US"]}
}
}
var url = "https://graph.facebook.com/v2.12/act_"+req.body.ADACCOUNT_ID+"/adsets?access_token="+req.body.access_token;
request({url:url, qs: createAdset_params}, function(err, response, body) {
if(err) {
console.log(err); return;
}
console.log("create adset result", body);
res.send(body);
});
Showing admin permission error, even if the access_token
is admin's access_token
which is success with on first call.
Is there someone success with the format of below one(regular post request format)?
Any kind of hint will greatly appreciate!