On version 1.1 of the Twitter API, we could use "account/verify_credentials".
However this now requires Elevated access to use the 1.1 version of the API.
Is there a way todo it using the V2 part of the Twitter API?
Edit: all I need is the username
2
Answers
At the moment, there is not a way to do this in v2. However, a future API feature may add this (probably as part of the OAuth 2.0 user implementation that is currently being worked on).
You can request elevated access to get to v1.1 endpoints for free.
It can be done through the
GET /2/users/me
API call, but that requires both thetweet.read
andusers.read
scopes. This has the side effect of letting the app read tweets from any protected accounts you follow (and perhaps subscriber-only tweets).Ideally, Twitter would just implement OpenID Connect, but it currently does not. With that, you’d get an
id_token
in addition to theaccess_token
andrefresh_token
. Theid_token
would identify which account was being used.