Reputation: 1509
I try to get video details from my Creative through Facebook Marketing API.
Here is my code:
Api::init(
env('ADS_APP_ID'),
env('ADS_APP_SECRET'),
env('ADS_ACCESS_TOKEN')
);
$account = new AdAccount(env('ADS_ACCOUNT_ID'));
$adcreatives = $account->getAdCreatives(array(
AdCreativeFields::VIDEO_ID,
));
$video_id = $adcreatives[0]->{AdCreativeFields::VIDEO_ID};
$ad_video = new AdVideo($video_id);
dd($ad_video->getSelf([AdVideoFields::THUMBNAILS]));
Also I have added necessary permissions in my App and double checked everything, I have:
Every seems fine and it should work, but I am getting this error:
FacebookAds\Http\Exception\AuthorizationException (#10) This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages and https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS for details.
Upvotes: 0
Views: 597
Reputation: 1509
After conversation with @CBroe in comments section, I can summarise steps which I did to avoid that error message:
pages_read_engagement
)Additionally if you want token, which will not expire in couple of hours, you can generate it here Long-Lived User Access Token
Upvotes: 0