[twitter-dev] Twitter API : 500 Internal Server Error

2011-05-14 Thread Ramkumar
I tried to use Twitter API  to post a tweet using Javascript in a
Google Chrome Extension . Details Below

Base String

POST&http%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses
%2Fupdate.json&oauth_consumer_key%3DXXX%26oauth_nonce
%3D9acc2f75c97622d1d2b4c4fb4124632b1273b0e0%26oauth_signature_method
%3DHMAC-SHA1%26oauth_timestamp%3D1305227053%26oauth_token%3D159970118-
XXX%26oauth_version%3D1.0%26status%3DHello

Header

OAuth
oauth_nonce="9acc2f75c97622d1d2b4c4fb4124632b1273b0e0",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1305227053",
oauth_consumer_key="X",
oauth_token="159970118-XX",
oauth_signature="IWuyoPJBrfY03Hg5QJhDRtPoaDs%3D",
oauth_version="1.0"

I used POST method with body "status=Hello"

But i get a 500 INTERNAL SERVER ERROR.. IS there any mistake on my
side ??

Javascript code used

h is the header given above

tweet="Hello"

encodeURLall is user defined which is working in all other occasions.

var xhr = new XMLHttpRequest();
xhr.open("POST","http://api.twitter.com/1/statuses/update.json";,
false);
xhr.setRequestHeader("Authorization",h);

xhr.onreadystatechange = function() {

if (xhr.readyState == 4 )
{
console.log("STATUS="+xhr.status);
console.log("RESPONSE="+xhr.responseText);
}
}

xhr.send("status="+encodeURLall(tweet));

}

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk


[twitter-dev] API doubts HELP

2011-05-09 Thread Ramkumar
I am developing a chrome extension for twitter (yeah another one ;-)).
I have few doubts from twitter’s API documentation at the
implementation. I will use javascript code to clear doubts.

BASE STRING

var xhr = new XMLHttpRequest();
xhr.open(METHOD,URL, false);
xhr.setRequestHeader("Authorization",HEADER);

xhr.onreadystatechange = function() {

if (xhr.readyState == 4 )
{
//func
}
}

xhr.send(BODY);
}

HEADER: usual header with oauth details (same for all)

FOR UPDATING STATUS
BASE STRING: should have the usual oauth details with URL as given
below and also BODY as give below
METHOD: POST
URL: http://api.twitter.com/1/statuses/update.json
BODY: status=something

Result: INTERNAL SERVER ERROR

FOR GETTING TIMELINE BY COUNT
BASE STRING: should have the usual oauth details with URL as given
below
METHOD: GET
URL: http://api.twitter.com/version/statuses/home_timeline.json?count=200
BODY: count=200

Result: INVALID SIGNATURE

RETWEETING
BASE STRING: should have the usual oauth details with URL as given
below
METHOD: POST
URL: http://api.twitter.com/version/statuses/retweet/:id.json
BODY: null
“id” in the url means id specified in the json of the tweet.

Result:  NOT FOUND ERROR


Please clear my mistakes and any changes I need to make.

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk