I am building a Twitter app (with oAuth) and I cannot find any info on how I can get the current user's info.
By current user, I mean the user which granted my app permissions and for whom the app is making the requests to the API.
Any suggestions?
Link to the documentation for API v. 1.1: https://dev.twitter.com/docs/api/1.1/get/account/verify_credentials
Using oAuth you are able to make calls to get user info from your TwitterOAuth object.
e.g if
Solution respecting iOS:
1) If you have a Twitter account (i.e.
ACAccount
fromACAccountStore
) on your device, the only thing you need is to attach it to SLRequest and get all the user info from the returned dictionary:2) Otherwise - you need to send OAuth (X-Auth) user credentials. The easiest way is to use TWTROAuthSigning class to retrieve OAuth-params:
and than send the ordinary request attaching credentials as header fields:
If you support an old version of Twitter SDK or searching for more options I'd recommend to look at STTwitter lib
It was actually "account/verify_credentials" as seen here: