Monday, May 20, 2024
150
rated 0 times [  157] [ 7]  / answers: 1 / hits: 17242  / 13 Years ago, thu, june 16, 2011, 12:00:00

I want to get an access_token according to this documentation http://dev.twitter.com/doc/post/oauth/request_token. I use javascript.



$.ajax({
url: http://api.twitter.com/oauth/request_token,
type: POST,
contentType: json,
data: {
oauth_consumer_key: DFwQqCnOTaYVbZQdBFqpR,
oauth_signature_method: HMAC-SHA1,
oauth_timestamp: parseInt((new Date()).getTime() / 1000),
oauth_nonce: R + parseInt((new Date()).getTime() / 1000),
oauth_version: 1.0
},
success: function (data) {
debugger;
},
error: function (a, b, c) {
debugger;
}
});


But it does not work at all. Always return error, never success.


More From » twitter-oauth

 Answers
2

You are not signing your request. You can read a more in depth direction on how to sign an OAuth reqeust on dev.twitter.com. You will likely want to use a JavaScript library to generate oauth_signature.


[#91671] Wednesday, June 15, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kylee

Total Points: 60
Total Questions: 119
Total Answers: 101

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
;