-
Go to your applications. Create a new one, and find the values in the Consumer Key and Consumer Secret fields.
-
Use OAuth client information to produce an OAuth 2 access token:
curl -i --user <consumer_key>:<consumer_secret> -X POST https://api.twitter.com/oauth2/token -d "grant_type=client_credentials" {"access_token":"<oauth2_token>","token_type":"bearer"}%