POST oauth/access_token
This is the third step in the OAuth 1.0a 3-legged OAuth flow, which can be used to generate a set of user Access Tokens.
A successful request to this endpoint allows an App to exchange the OAuth Request Token for an OAuth Access Token. This method fulfills Section 6.3 of the OAuth 1.0 authentication flow.
Endpoint URL¶
https://api.twitter.com/oauth/access_token
Resource Information¶
Authentication | Not required |
Query parameters¶
Name | Required | Description |
oauth_token | required | The oauth_token here must be the same as the oauth_token returned by the POST oauth/request_token endpoint in step 1 of the flow. |
oauth_verifier | required | If using the OAuth web-flow, set this parameter to the value of the oauth_verifier returned as a query parameter in the callback URL by the GET oauth/authorize or GET oauth/authenticate endpoints in step 2 of the flow. If you are using out-of-band OAuth (you set the callback URL value to oob in step 1, and therefore are using pin-based authorization), set this value to the pin-code that the user passed along to you. |
Example request
When using a specified callback URL:
curl --request POST \
--url 'https://api.twitter.com/oauth/access_token?oauth_verifier=ghLM8lYmAxDbaqL912RZSRjCCExxxxxx&oauth_token=_3toBAAAAAAA2_NZAAABfxxxxxx'
When using pin-based authorization:
curl --request POST \
--url 'https://api.twitter.com/oauth/access_token?oauth_verifier=14319xx&oauth_token=_3toBAAAAAAA2_NZAAABfxxxxxx'
Example response
oauth_token=62532xx-eWudHldSbIaelX7swmsiHImEL4KinwaGloxxxxxx&oauth_token_secret=2EEfA6BG5ly3sR3XjE0IBSnlQu4ZrUzPiYxxxxxx&user_id=6253282&screen_name=twitterapi