AnsweredAssumed Answered

get_entry_list : get all records from leads

Question asked by Shumaila Shumaila on Feb 4, 2015
Latest reply on Feb 5, 2015 by Shumaila Shumaila
Hello All ,


I need to get records of all leads for which I have used this API , but I am unable to get all records. Instead of that I am only able to get '1000' records. (I have tried to get count of all records (i.e echo $get_entries_count_result->result_count; which is giving me accurate no of total but  I can not use this in max_results as variable) . Please help . Why


<?php
include_once("config.php");
        //function to make cURL request

$get_entries_count_parameters = array(
     //Session id
     'session' => $session_id,
     //The name of the module from which to retrieve records
     'module_name' => 'Leads',
     //The SQL WHERE clause without the word "where".
     'query' => "",
     //If deleted records should be included in results.
     'deleted' => false
);

 $get_entries_count_result = call('get_entries_count', $get_entries_count_parameters, $url);

//echo $get_entries_count_result->result_count;

    //get list of records --------------------------------   
    $get_entry_list_parameters = array(

         //session id
         'session' => $session_id,

         //The name of the module from which to retrieve records
         'module_name' => 'Leads',

         //The SQL WHERE clause without the word "where".
         'query' => "",

         //The SQL ORDER BY clause without the phrase "order by". 
         'order_by' => "name asc",

         //The record offset from which to start.
         'offset' => '0',

         //Optional. A list of fields to include in the results.
         'select_fields' => array(
              'id',
              'name',
              'title',
         ),

         /*
         A list of link names and the fields to be returned for each link name.
         Example: 'link_name_to_fields_array' => array(array('name' => 'email_addresses', 'value' => array('id', 'email_address', 'opt_out', 'primary_address')))
         */
         'link_name_to_fields_array' => array(
         ),

         //The maximum number of results to return.
         'max_results' =>'1000',

         //To exclude deleted records
         'deleted' => '0',

         //If only records marked as favorites should be returned.
         'favorites' => false,
    );
   $get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url);
?>

Outcomes