Note that there are some explanatory texts on larger screens.

plurals
  1. POTagging friends in status updates from Facebook API
    text
    copied!<p>I recently came across <a href="http://www.insidefacebook.com/2009/09/14/developer-tip-how-to-tag-friends-in-status-updates-from-your-app-undocumented/" rel="nofollow">this blog post</a> that said that it's possible to tag someone in a status update from a Facebook app (= from the API):</p> <p>However, it doesn't seem to work for me.</p> <p>It tried it in three different ways:</p> <pre><code>$post = $facebook-&gt;api('/me/feed', 'post', array( 'access_token' =&gt; $session['access_token'], 'message' =&gt; 'Hello @[562372646:Lionel Cordier], how are you?' )); </code></pre> <p>or</p> <pre><code>$access_token = $session['access_token']; $message = 'Hello @[562372646:Lionel Cordier], how are you?'; $curl_post = 'access_token='.$access_token.'&amp;message='.$message; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/me/feed'); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post); $data = curl_exec($ch); curl_close($ch); </code></pre> <p>or</p> <pre><code>$access_token = $session['access_token']; $message = 'Hello @[562372646:Lionel Cordier], how are you?'; $curl_post = 'access_token='.$access_token.'&amp;status='.$message; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.facebook.com/method/users.setStatus'); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post); $data = curl_exec($ch); curl_close($ch); </code></pre> <p>But nothing works. The result I have is "<em>Hello @[562372646:Lionel Cordier], how are you?</em>" on my wall.</p> <p>But if I type "<em>Hello @[562372646:Lionel Cordier], how are you?</em>" directly in Facebook, it works correctly.</p> <p><strong>What am I doing wrong?</strong></p>
 

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