I have access token and access token secret of the user, how do i make an Ajax call to submit a tweet in javascript. I can tweet using C#, but I am not sure how to pass the the required tokes (consumer key, consumer secret, access token and access token secret) through an ajax call.
Following is the code I have, but how do I pass the tokens (I have access to the tokens in this context) here?
$.ajax({
url: 'https://api.twitter.com/1.1/statuses/update.json?status=hello&callback=?’,
dataType: ‘jsonp’,
cache: false,
crossDomain: true,
scriptCharset: “utf-8”,
contentType: “application/json; charset=utf-8”,
success: function (data) {
alert(“successfully tweeted” + " hello");
},
error: function (jqXHR, textStatus, errorThrown) {
alert(“error occurred” + errorThrown + " text status" + textStatus);
}
});