Can't access follower list by 1.1 Rest API


#1

I always getting "Sorry, that page does not exist [code] => 34 " while try to get follower list by 1.1 rest API … I have tried different screen names but getting same result

stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Sorry, that page does not exist [code] => 34 ) ) )

Here is the code

<?php
    header('Content-type: text/html; charset=utf8');
    require_once("autoload.php"); 
    require_once("src/TwitterOAuth.php"); 
    use Abraham\TwitterOAuth\TwitterOAuth;
        // consumer ve access
        $consumerkey = "xyz";
        $consumersecret = "xyz";
        $accesstoken = "573746879-xyz";
        $accesstokensecret = "xyz";

        // sınıfı başlatalım
        $connection = new TwitterOAuth($consumer_key, $consumer_secret, $access_token, $access_token_secret);

        
      $sn = "mooinooicat" ;
    
      $results  = $connection->get("https://api.twitter.com/1.1/followers/list.json?screen_name=$sn");
      print_r($results);

      ?>

#2
  1. You need to go to https://apps.twitter.com/ and reset the consumer key/secret for the app and not publish them publicly anymore.

  2. That’s not the documented API for TwitterOAuth. You should be doing something like this:

    $results = $connection->get(“followers/list”, [“screen_name” => $sn]));