Pagination cursor issue On GET request


#1

Hello All,

We are having one strange issue one GET request of user API below error message we are getting on setting cursor to 1.If we set it to -1 its working fine but we want to get details of all contact as there is one limit in page with 200 contact in one page so how we get other.

We are taking reference of https://dev.twitter.com/rest/reference/get/friends/list

Response we are getting.

Array
(
[users] => Array
(
)

[next_cursor] => 0
[next_cursor_str] => 0
[previous_cursor] => -1
[previous_cursor_str] => -1

)
1

Getting issue with on fetching information for user whose friends count are 209 so we need to navigate to 2 page too but not possible due to the bad response we are getting.

Array
(
[followercount] => 100439
[friendscount] => 209
)

Code sample which we are using.

$url = “https://api.twitter.com/1.1/friends/list.json”; //Get list of followers
$requestMethod = “GET”;
$getfield = “?cursor=1&user_id=23083434&count=20”;
$twitter = new TwitterAPIExchange($settings);
$string = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();

thanks.