title: How call twitter API Using Javascript
body: <p>I have created a App in twitter account . I trying to fetch tweet for particular hashtag but  I don't know how to run URL and Use access token in this. And I am unable to find JS SDK. I am new for twitter and confused about this.</p>
  
  <p>I have find out this code but it is getting 400 bad request error. Please help me</p>
  
  <pre class="lang-js prettyprint-override"><code> $.ajax({
          url: "https://api.twitter.com/1.1/statuses/user_timeline.json?",
          type: "GET",
          data: {count:10 },//cursor: "-1", 
                 // screen_name: "sitestreams" },
          cache: false,
          dataType: 'json',
  
          success: function(data) { alert('hello!'); console.log(data);},
          error: function(html) { alert(html); },
          beforeSend: setHeader
      });
      function setHeader(xhr) {
          if(xhr &amp;&amp; xhr.overrideMimeType) {
              xhr.overrideMimeType("application/j-son;charset=UTF-8");
          }
          xhr.setRequestHeader('Authorization: OAuth oauth_consumer_key="qqqq7a3ansbRqqqTfOBdX4hn2sQJp72a", oauth_nonce="a3df1878qqqqe0b6d644f6ac0fd3a354725a", oauth_signature="%qqqqq2BhZ4eYIjnJc0fcHU2VHhrjvR0Ns%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1435qqqqq579396", oauth_token="468141855-Id6phQoOE66n9CBzAdqqqqwEUAuQI2qqqqTBmxGyUHL9xarx", oauth_version="1.0"');
      }
  </code></pre>
  
  <p>How to use these outh signatures</p>
  
  <p>OAuth Signing Results</p>
  
  <blockquote>
    <p>Important: This will only be valid for a few minutes. Also remember
    the cURL command will actually execute the request.  null 
    nullSignature base string  null 
    nullGET&amp;https%3A%2F%2Fapi.twitter.com%2F1.1%2Ffriends%2Flist.json&amp;amp%253Binclude_user_entities%3Dfalse%26amp%253Bscreen_name%3Dtwitterapi%26amp%253Bskip_status%3Dtrue%26cursor%3D-1%26oauth_consumer_key%3D7a3addsssdnsbRTfOBdX4hn2sQJp72a%26oauth_nonce%3D84d92acbc6ssssddd8ff3ecd2fa72e8dc64c4fc%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1445456635455642473%26oauth_token%3D468141855-Id6phQoOE66n9CBzAdwsddEUAuQI2TBmxGyUHL9xarx%26oauth_version%3D1.0
    null  nullAuthorization header  null  nullAuthorization: OAuth
    oauth_consumer_key="7a3ansbRsssssTfOBdX4hn2sQJp72a",
    oauth_nonce="84d92acbsssc68ff3ecd2fa72e8dc64c4fc",
    oauth_signature="DThJZIUNssDNA8rtHt7R6x04aAGVM%3D",
    oauth_signature_method="HMAC-SHA1", oauth_timestamp="1435642473",
    oauth_token="468145641855-Id6phQoOE66ssn9CBzAdwEUAssuQI2TBmxGyUHL9xarx",
    oauth_version="1.0"  null  nullcURL command  null  nullcurl --get
    '<a href="https://api.twitter.com/1.1/friends/list.json" rel="nofollow">https://api.twitter.com/1.1/friends/list.json</a>' --data
    'amp%3Binclude_user_entities=false&amp;amp%3Bscreen_name=twitterapi&amp;amp%3Bskip_status=true&amp;cursor=-1'
    --header 'Authorization: OAuth oauth_consumer_key="7a3ansbRTsssfOBdX4hn2sQJp72a",
    oauth_nonce="84d9ss2acbc68ff3ecd2fa72e8dc64c4fc",
    oauth_signature="DThJZIUNDssssNA8rtHt7R6x04aAGVM%3D",
    oauth_signature_method="HMAC-SHA1", oauth_timestamp="143564542473",
    oauth_token="468141851235-Id6phQoOE66n9CBsssszAdwEUAuQI2TBmxGyUHL9xarx",
    oauth_version="1.0"' --verbose  null  null</p>
  </blockquote>