Skip to content

Getting OAuth 1.1 Error after specifying to use Version 2 #1255

@andrebruton

Description

@andrebruton

Searching Tweets using twitteroauth works perfectly, but when requesting Twitter usage using /2/usage/tweets I keep getting an OAuth 1,1 error.

$connection = new TwitterOAuth($twitter_consumer_key, $twitter_consumer_secret, $twitter_access_key, $twitter_access_secret); $connection->setApiVersion('2'); $response = $connection->get('usage/tweets'); print_r($response);

This returns:

stdClass Object ( [title] => Unsupported Authentication [detail] => Authenticating with OAuth 1.0a User Context is forbidden for this endpoint. Supported authentication types are [OAuth 2.0 Application-Only]. [type] => https://api.twitter.com/2/problems/unsupported-authentication [status] => 403 )

I'm specifying the code to use version 2

All I want is to read how many searches I can still do in aq severly limited rate cycle on X.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions