Shinu Thomas
Shinu Thomas

Reputation: 5316

Another method for sharing link on facebook wall using Graph API

Is their any alternate php code for sharing link on Facebook. I'am using this code for sharing a link on facebook wall.

$ret_obj = $this->facebook->api('/me/feed', 'POST', array(
                                      'link' => 'www./excample.com',
                                      'message' => 'Posting with the PHP SDK!'
                               ));
echo '<pre>Post ID: ' . $ret_obj['id'] . '</pre>';

Upvotes: 2

Views: 4434

Answers (2)

Shinu Thomas
Shinu Thomas

Reputation: 5316

Instead of `feed` use `links`


$ret_obj = $this->facebook->api('/me/links', 'POST', array(
                                          'link' => 'www./excample.com',
                                          'message' => 'Posting with the PHP SDK!'
                                   ));

Upvotes: 5

You can use the /links endpoint : https://graph.facebook.com/me/links

Use a post request with "link" parameter.

Cheers!

Upvotes: 3

Related Questions