Reputation: 11293
I just want to validate that a Twitter user exists. My code is returning 401 Unauthorised with this
$("#getUsr").click(
function()
{
var FindUser = $('#frmTwitter').val();
$.getJSON(
'http://api.twitter.com/1/users/' + FindUser + '.json?callback=?',
function(json) {
console.log(json);
}
);
}
);
what am I doing wrong?
Upvotes: 0
Views: 2199
Reputation: 6126
All of Twitters API's require you to first authenticate with them.
http://dev.twitter.com/pages/auth
Upvotes: 0
Reputation: 94469
Try using this url: "http://api.twitter.com/1/users/show.json?screen_name=" + user_name
You can also look at this post: Check if twitter username exists
Upvotes: 0
Reputation: 9227
Where did you get that URI from?
Use instead:
'http://api.twitter.com/1/users/show.json?screen_name=' + FindUser
See API doc on users/show
Upvotes: 1