Twitter API v2 authentication uses OAuth2 and requires app consumer keys or bearer token.

# S3 method for twitter2
Authenticate(socialmedia, consumerKey, consumerSecret, bearerToken, ...)

Arguments

socialmedia

Character string. Identifier for social media API to authenticate, set to "twitter2".

consumerKey

Character string. API consumer key to authenticate.

consumerSecret

Character string. API consumer secret to authenticate.

bearerToken

Character string. API access token to authenticate.

...

Additional parameters passed to function. Not used in this method.

Value

A credential object containing a bearer token $bearer and social media type descriptor $socialmedia set to "twitter2". Object has the class names "credential" and "twitter2".

Examples