Limited number of API responses

007

Member
Hi all,
I'm running this API command, and I'm only receiving back 10 response values. How can I receive all of the values (there are 13) as an array into a variable?

Code:
$endpoint = new MailWizzApi_Endpoint_ListSegments();
$response = $endpoint->getSegments($listUid);

I'm guessing it has something to do with pages.

Here is the code I'm using to get the response data into a variable.
Code:
$second_level_array = $response->body['data'];
$third_level_array = $second_level_array['records'];

Here is the top section of the API response, which shows that there are 2 total pages. I'm assuming the last 3 results are on the second page.
Code:
MailWizzApi_Params::__set_state(array(
   '_data' =>
  array (
    'status' => 'success',
    'data' =>
    array (
      'count' => '13',
      'total_pages' => 2,
      'current_page' => 1,
      'next_page' => 2,
      'prev_page' => NULL,
      'records' =>
      array (
        0 =>
 
Last edited:
Thanks, that's what I needed.

If anyone else is reading this and needs help with the same problem, here's the code I ended up using.
Code:
$response = $endpoint->getSegments($listUid, $page = 1, $perPage = 9999);
 
Back
Top