Note that there are some explanatory texts on larger screens.

plurals
  1. POgetAccessToken() returns code 215
    text
    copied!<p>I'm trying to have a page which gets tweets from a specific hashtag (Say for example, #Twitter). My code is giving me the following error :</p> <pre><code>stdClass Object ( [errors] =&gt; Array ( [0] =&gt; stdClass Object ( [message] =&gt; Bad Authentication data [code] =&gt; 215 ) ) ) </code></pre> <p>This error occured after I changed this:</p> <pre><code>$tok = $connection-&gt;getAccessToken(); </code></pre> <p>To this:</p> <pre><code>$tok = $connection-&gt;getAccessToken($_REQUEST['oauth_verifier']); </code></pre> <p>I am using Abraham's <a href="https://github.com/abraham/twitteroauth" rel="nofollow">Oauth</a> Library </p> <p>Does this error have something to do with the change I made?</p> <p>Edit: The following is all the php code from the relevant page.</p> <pre><code> &lt;?php session_start(); ?&gt; &lt;?php require_once('config.php'); ?&gt; &lt;?php require_once('twitterOAuth/twitterOAuth.php'); ?&gt; &lt;?php require_once('twitterOAuth/OAuth.php'); ?&gt; &lt;?php error_reporting(E_ALL ^ E_NOTICE); if ((!isset($_SESSION['oauth_access_token'])) || ($_SESSION['oauth_access_token'])=='') { $to = new TwitterOAuth($consumer_key, $consumer_secret, $_SESSION['oauth_request_token'], $_SESSION['oauth_request_token_secret']); $tok = $to-&gt;getAccessToken($_REQUEST['oauth_verifier']); $_SESSION['oauth_access_token'] = $token = $tok['oauth_token']; $_SESSION['oauth_access_token_secret'] = $tok['oauth_token_secret']; } if (isset($_GET['oauth_token'])) { $ot = $_GET['oauth_token']; } $Content = $to-&gt;get('search/tweets', array('q' =&gt; '#Twitter')); echo $_REQUEST['oauth_verifier']; ?&gt; </code></pre>
 

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