Reputation: 31
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
Upvotes: 2
Views: 1959
Reputation: 394
It can be done through the GET /2/users/me
API call, but that requires both the tweet.read
and users.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 the access_token
and refresh_token
. The id_token
would identify which account was being used.
Upvotes: 1
Reputation:
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.
Upvotes: 1