Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>well the api url to post a status update on behalf of the user is <code>https://graph.facebook.com/USERID/feed</code> with <code>POST</code> http request and the authorization token, so you have to basically make at least three calls (one to get, with <code>GET</code> method, the auth token, one to get the user's info, and one to post, with <code>POST</code> method). The <code>POST</code> "action" has a series of attributes, such as the link, the message, privacy, caption, etc. etc. but don't forget the token or it doesn't work... If you test it with yourself it's going to be easier (because you can get the tokens, and yours never expires, on the <a href="https://developers.facebook.com/tools/explorer" rel="nofollow">Graph Explorer Tool</a>). See if it works. </p> <p>EDIT: here's an example in php, by <a href="https://github.com/facebook/facebook-php-sdk" rel="nofollow">Facebook</a>, edited for your purpose. </p> <pre><code>&lt;? require '../src/facebook.php'; // Create our Application instance (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' =&gt; ' ', 'secret' =&gt; ' ', )); // Get User ID $user = $facebook-&gt;getUser(); // We may or may not have this data based on whether the user is logged in. // // If we have a $user id here, it means we know the user is logged into // Facebook, but we don't know if the access token is valid. An access // token is invalid if the user logged out of Facebook. if ($user) { //if there's an user logged in //build an array with some paramenters $parameters = array( 'message' =&gt; "isn't it nice when things just work?", 'picture' =&gt; "", 'link' =&gt; "", 'name' =&gt; "", 'caption' =&gt; "", 'description' =&gt; "" //etc. If parameters are blank but at least one is there, it doesn't matter. ); //add the access token to it or it doesn't work $parameters['user_access_token'] = $_SESSION['user_access_token']; //you get this somwhere else before posting //build a url to call the Graph API with POST HTTP request try { $updateyourstatus = $facebook-&gt;api("/$user/feed", 'post', $parameters)); } catch (FacebookApiException $e) { d($e); } } </code></pre> <p>//Hopefully all brackets are closed.</p> <pre><code>?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload