0

I can use the API to post to my facebook following the example at Simple example to post to a Facebook fan page via PHP?, as below

$data['picture'] = $image_URL;
$data['link'] = $link_URL;
$data['message'] = $message_TEXT;
$data['caption'] = $caption_TEXT;
$data['description'] = $description_TEXT;
$data['access_token'] = $page_access_token;

$post_url = 'https://graph.facebook.com/'.$page_id.'/feed';

try{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $post_url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $return = curl_exec($ch);
    curl_close($ch);
}catch (Exception $e) {
    echo 'ERROR '.$e.' in CURL for Facebook posting';
}

Is it possible to do something similar to share a post, if we know the URL of the post (e.g. https://www.facebook.com/TED/posts/10159368542595652)

user1505631
  • 527
  • 4
  • 13
  • If you want to share a post on Facebook - then use the post URL as value for the `link` parameter ... (You won’t be able to override title, description, thumbnail etc. any more - but that doesn’t work for sharing external links any more either.) – CBroe Sep 25 '17 at 07:08
  • Thanks. When I try that, it adds the facebook link as if it were an external link. Is there any way to make a post that looks like a share? – user1505631 Sep 26 '17 at 22:41
  • Not sure what you mean, sharing the TED post via the UI, and making a post via API setting it as the `link` gets me the same result ... – CBroe Sep 27 '17 at 08:26

0 Answers0