I am working on the facebook ads API (3.2) But I am getting some weird errors. I am trying to get the campaigns
And following is the method I am using for this according to the documentation Here
public function getcampaigns() {
$adaccount = new AdAccount('331*****10774');
$campaigns = $adaccount->getCampaigns();
print_r($campaigns);
}
Then I try this with Explorer with the same access_token
and it worked well.
I am giving the following permissions in access_token
$this->permissions = ['email', 'ads_management', 'pages_show_list', 'publish_pages', 'manage_pages', 'ads_read', 'business_management'];
2
Answers
You need to get your APP approved by Facebook to access the permission ads_management
It will work on explorer since it’s just a tool FB has provided to test and play around.
You should prefix with the
act_
string, sotry this:
instead of this:
In addition, if you test the example:
Works as expected
Hope this help