How to get a permanent link to a Facebook ad using Facebook APi

When using the ad manager, you can view the ad. There is also a hyperlink that goes to View Post Permalink with comments. Is there any way to get this link using the API

+4
source share
1 answer

You must first get an ad targeted to the ad.

$ad = new Ad($ad_id);
$ad->read(array(
    AdFields::CREATIVE,
));

Then enter the information from the ad.

$creative = new AdCreative($ad->creative['id']);
$creative->read(array(
    AdCreativeFields::EFFECTIVE_OBJECT_STORY_ID,
));

$creative->effective_object_story_id , xxxxxxxxxxxxx_yyyyyyyyyyyyy, x - , y - //etc. https://facebook.com/xxxxxxxxxxxxx_yyyyyyyyyyyyy,

, -.

+4

Source: https://habr.com/ru/post/1653219/


All Articles