title: Twitter API - how to check if user A follows user B
body: <p>My problem is quite strange (at least to me) as I have a request URL that works in the console but throws the <code>Sorry, that page does not exist</code> error in my php script, even though the connection is up and running.</p>
  
  <p>So this</p>
  
  <pre><code>$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_secret']);
  $user = $connection-&gt;get('account/verify_credentials');
  print_r($user);
  </code></pre>
  
  <p>works great, the $user data is printed out on the screen.</p>
  
  <p>However, I am unable to check a friendship status as:</p>
  
  <pre><code>$x = $connection-&gt;get('https://api.twitter.com/1.1/friendships/show.json?source_id=707482092&amp;target_id=755811768&amp;target_screen_name=assetspersonifi');
  </code></pre>
  
  <p>As I get the error.</p>
  
  <p><strong>When I put this request into the Twitter API console, it gives back the json</strong> that I don't receive in my php code. </p>
  
  <p>I'm using <a href="https://github.com/abraham/twitteroauth" rel="nofollow">Abraham's twitteroauth library</a> but this does not work either:</p>
  
  <pre><code>$follows_faelazo = $connection-&gt;get('friendships/exists', array('user_a' =&gt; 'blfarago', 'user_b' =&gt; 'faelazo'));
  if(!$follows_faelazo){
      echo 'You are NOT following @faelazo!';
      $connection-&gt;post('friendships/create', array('screen_name' =&gt; 'faelazo'));
  } else {
      print_r($follows_faelazo);
  }
  
  stdClass Object ( [errors] =&gt; Array ( [0] =&gt; stdClass Object ( [message] =&gt; Sorry, that page does not exist [code] =&gt; 34 ) ) )
  </code></pre>
  
  <p>I read that <code>friendships/exists</code> API is no longer supported by the Twitter API and I should use <code>friendships/show</code> but how if it's not working as you see above?</p>
  
  <p>To prove that everything else is working, I can follow others with</p>
  
  <pre><code>$connection-&gt;post('friendships/create', array('screen_name' =&gt; 'faelazo'));
  </code></pre>
  
  <p>Why?</p>