Steven
Steven

Reputation: 3813

Get Twitter screen name from "oauth_token" and "oauth_token_secret"

I have the "oauth_token" and "oauth_token_secret" values stored in the database. Is it possible to retrieve the twitter account's user name from just these two values?

Upvotes: 0

Views: 1086

Answers (1)

air-dex
air-dex

Reputation: 4178

You can do it with this REST method : GET https://api.twitter.com/1/account/verify_credentials.json (or .xml if you prefer XML results instead of JSON). It is an authenticated request, so you will pass the oauth_tokenin the Authorization header as usual. If the request is successful, it will return you the 200 OK HTTP code with the corresponding user. Otherwise it will return a 401 return code. The Twitter application used for the request has to authorized by the user of course.

Upvotes: 1

Related Questions