0

Is it possible to add a link to the message when doing a custom publish with Graph API?

For eg:

<?php
$msg_body = array(
   'source' => '@'.realpath('somephoto/hey.png'),
   'message' => 'message to my wall <a href="http://likethis.com">Go here!</a>'
);
?>
Bruno Mota
  • 111
  • 2
  • 9
  • not tried but you use link parameter 'link' => 'www.mysite.com', try http://stackoverflow.com/questions/13897123/graph-api-new-feed-post-object-attachment-not-showing/14029173#14029173 – Rakesh Sharma Feb 27 '14 at 09:54

2 Answers2

0

No. Its not possible to embade link the way you are trying.

But try as given in documentation

Facebook Documentation URL

$facebook->api('/me/feed', ...)
Rohit Awasthi
  • 686
  • 3
  • 12
  • Yes, that way is possible, but how its possible to do it when publishing photos? $facebook->api('/page_id/photos', $args); – Bruno Mota Feb 27 '14 at 10:45
0

Short term answer is yes, But not as you write. When you write a link in message parameter, Write it normal without tags.

<?php
   $msg_body = array(
  'source' => '@'.realpath('somephoto/hey.png'),
  'message' => 'message to my wall http://likethis.com"
 );
?>

Long term answer is, You can use link parameter instead, But that will not go with source parameter as:-

<?php
   $msg_body = array(
  'link' => 'http://likethis.com',
  'message' => 'message to my wall "
 );
?>
Nedal Eldeen
  • 159
  • 1
  • 7