I used Anywhere from twitter and connectButton from it which connected my app with page and account. How can I update my status now without textbox? Just send some request with need new status string. I found this oficial page:
Example Requests
POST https://api.twitter.com/1/statuses/update.json
status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true
So I wrote:
$.post('https://api.twitter.com/1/statuses/update.json', {status: 'test'}, function(res) {
console.log(res);
});
And it returns 401 auth error. So, any ideas?
I think you are mixing up the Twitter REST API with the @Anywhere library. The REST API can only be used when an user is authenticated with oAuth and the application provides an oAuth key in the HTTP request. The @Anywhere library is another library that provides easier access to Twitter for web developers using a Javascript library.
You receive a 401 authentication error because you haven’t supplied oAuth headers with the API request, which means that an user is not authenticated for the API. This is independent from the authentication scheme for @Anywhere (the connect button).
You either have to rewrite your code so that you first authenticate an user via oAuth and then use a REST call to post a tweet, or you have to use the features of the @Anywhere library to provide users a tweet box.