Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook API OAuth Excpetion #200 with '&scope=publish_steam'
    primarykey
    data
    text
    <p>Trying to post a status update using facebook php sdk. Code posted below. As I understand it, I need ask for extended persmission, which I do in the login URL with '&amp;scope=publish_stream', but this still isn't working.</p> <p>The resultant login URL looks like: <a href="https://www.facebook.com/login.php?api_key=174954539217971&amp;cancel_url=http%3A%2F%2Fexample.com%2facebook.post.php&amp;display=page&amp;fbconnect=1&amp;next=http%3A%2F%2Fexample.com%2Ffacebook.post.php&amp;return_session=1&amp;session_version=3&amp;v=1.0&amp;scope=publish_stream" rel="nofollow noreferrer">https://www.facebook.com/login.php?api_key=174954539217971&amp;cancel_url=http%3A%2F%2Fexample.com%2facebook.post.php&amp;display=page&amp;fbconnect=1&amp;next=http%3A%2F%2Fexample.com%2Ffacebook.post.php&amp;return_session=1&amp;session_version=3&amp;v=1.0&amp;scope=publish_stream</a></p> <p>So you can see it is being set. While this is essentially the same question as: <a href="https://stackoverflow.com/questions/4158164/facebook-api-oauthexception-200">Facebook OAuthException: &quot;user hasn&#39;t authorized the application to perform this action&quot;</a></p> <p>The suggested solution in that thread is not working here.</p> <pre><code>&lt;?php echo "Posting to facebook..&lt;br/&gt;"; require './fb_src/facebook.php'; $facebook = new Facebook(array( 'appId' =&gt; 'appId', 'secret' =&gt; 'secret', 'cookie' =&gt; true, )); $session = $facebook-&gt;getSession(); $me = null; if ($session) { try { $uid = $facebook-&gt;getUser(); $me = $facebook-&gt;api('/me'); } catch (FacebookApiException $e) { header('Location: ' . $facebook-&gt;getLoginUrl(array('scope' =&gt; 'publish_stream'))); error_log($e); } } else { header('Location: ' . $facebook-&gt;getLoginUrl(array('scope' =&gt; 'publish_stream'))); } print_r($me); try { $feed = $facebook-&gt;api('/me/feed', 'post', array('message' =&gt; 'Hello world!', 'cb' =&gt; '')); } catch (FacebookApiException $e) { print($e); } print_r($feed); ?&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.
    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