Is endpoint oauth/request_token unvailable?


#1

Hi,

I tried a lot to solve this issue, but I didn’t found anything to solve it.
I’m printing this variable: $connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET);
Please help.

braham\TwitterOAuth\TwitterOAuth Object
(
[response:Abraham\TwitterOAuth\TwitterOAuth:private] => Abraham\TwitterOAuth\Response Object
(
[apiPath:Abraham\TwitterOAuth\Response:private] => oauth/request_token
[httpCode:Abraham\TwitterOAuth\Response:private] => 404
[headers:Abraham\TwitterOAuth\Response:private] => Array
(
[cache_control] => no-cache
[content_encoding] => gzip
[content_length] => 92
[content_security_policy] => ******************************************************
[content_type] => application/json;charset=utf-8
[date] => Mon, 29 Aug 2016 15:37:56 GMT
[server] => tsa_b
[set_cookie] => guest_id=v1%3A147248507634721969; Domain=.twitter.com; Path=/; Expires=Wed, 29-Aug-2018 15:37:56 UTC
[status] => 404 Not Found
[strict_transport_security] => max-age=631138519
[x_connection_hash] => 904311a2b1a14bfc6c07f265209bfe8d
[x_content_type_options] => nosniff
[x_frame_options] => SAMEORIGIN
[x_response_time] => 8
[x_transaction] => 00813a980040351a
[x_xss_protection] => 1; mode=block
)

        [body:Abraham\TwitterOAuth\Response:private] => stdClass Object
            (
                [errors] => Array
                    (
                        [0] => stdClass Object
                            (
                                [message] => Sorry, that page does not exist
                                [code] => 34
                            )

                    )

            )

        [xHeaders:Abraham\TwitterOAuth\Response:private] => Array
            (
                [x_connection_hash] => 904311a2b1a14bfc6c07f265209bfe8d
                [x_content_type_options] => nosniff
                [x_frame_options] => SAMEORIGIN
                [x_response_time] => 8
                [x_transaction] => 00813a980040351a
                [x_xss_protection] => 1; mode=block
            )

    )

[bearer:Abraham\TwitterOAuth\TwitterOAuth:private] => 
[consumer:Abraham\TwitterOAuth\TwitterOAuth:private] => Abraham\TwitterOAuth\Consumer Object
    (
        [key] => **************************************
        [secret] => ***************************************************
        [callbackUrl] => 
    )

[token:Abraham\TwitterOAuth\TwitterOAuth:private] => 
[signatureMethod:Abraham\TwitterOAuth\TwitterOAuth:private] => Abraham\TwitterOAuth\HmacSha1 Object
    (
    )

[timeout:protected] => 5
[connectionTimeout:protected] => 5
[decodeJsonAsArray:protected] => 
[userAgent:protected] => TwitterOAuth (+https://twitteroauth.com)
[proxy:protected] => Array
    (
    )

[gzipEncoding:protected] => 1

)


#2

Please include the line where you actually make the oauth/request_token call.


#3

require (“plugins/twitter/vendor/autoload.php”);
use Abraham\TwitterOAuth\TwitterOAuth;

$args = [
‘oauth_callback’ => urlencode($CALLBACK_URL)
];

$connection = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET);
$request_token = $connection->post(“oauth/request_token”, $args);

echo “

”;
print_r($connection);

#4

You should be using $connection->oauth("oauth/request_token", $args);


#5

Wow, that’s right!!!
Worked!

Man, I tried so many different ways and nothing.

Thank you!


#6