title: (401 Authorization Required) on Twitter API request
body: <p>I'm trying to do a simple request to Twitter API using AngularJS, based on <a href="https://www.youtube.com/watch?v=IRelx4-ISbs" rel="nofollow">this tutorial</a> and I get this error:</p>
  
  <pre><code>"GET http://search.twitter.com/search.json?callback=angular.callbacks._0&amp;q=angularjs 401 (Authorization Required)"
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>$scope.twitter = $resource('http://search.twitter.com/:action',
      {action:'search.json', q: 'angularjs', callback:'JSON_CALLBACK'},
      {get:{method:'JSONP'}}
  );
  </code></pre>
  
  <p>Does it relate to the following statement (taken from <a href="https://dev.twitter.com/docs/error-codes-responses" rel="nofollow">Twitter API docs</a>)?</p>
  
  <blockquote>
    <p>401 - Unauhtorized - (...) Also returned in other circumstances, for example all calls to API v1
    endpoints now return 401 (use API v1.1 instead).</p>
  </blockquote>
  
  <p>Why do I get this error? By using <code>http://search.twitter.com</code> as the resource, does that mean I'm using the most recent API (v1.1)? Can I choose which API i'm accessing? How? </p>
  
  <p>If I use <code>http://api.twitter.com</code> as the resource, I get a 403 error instead:</p>
  
  <p><code>Failed to load resource: the server responded with a status of 403 (Forbidden)</code></p>
  
  <p>which, according to the <a href="https://dev.twitter.com/docs/error-codes-responses" rel="nofollow">Twitter API docs</a>, implies that</p>
  
  <p><code>(...) This code is used when requests are being denied due to update limits.</code></p>
  
  <p>which does not make sense, because I tried that only a couple dozen times... I'm confused.</p>
  
  <p>Thanks</p>