When using ads manager, you can preview ad. There is also a hyperlink which goes View post permalink with comments. Is there any way to get that link using API
How to get Facebook ad permalink using Facebook APi
Asked Answered
First you must get the creative that's targeted by the ad.
$ad = new Ad($ad_id);
$ad->read(array(
AdFields::CREATIVE,
));
Then get the info from the creative.
$creative = new AdCreative($ad->creative['id']);
$creative->read(array(
AdCreativeFields::EFFECTIVE_OBJECT_STORY_ID,
));
Then $creative->effective_object_story_id
will contain an ID that would look like xxxxxxxxxxxxx_yyyyyyyyyyyyy, where x is the ID of the page, and y is the id of the post/video/etc.
If you just go to https://facebook.com/xxxxxxxxxxxxx_yyyyyyyyyyyyy it should redirect you to the correct post
Hope this helps someone.
© 2022 - 2024 — McMap. All rights reserved.
https://facebook.com/{page_id}/posts/{post_id}
but that doesn't seem to work for community pages. – Bibber