I am using CTM API for my web application. URL of docs is here. I am fetching data for list of activities and data arrived. But when I am passing parameters i.e. start_date
and end_date
the data does not change and only 10 rows are fetched and displayed.
My code is:
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.calltrackingmetrics.com/api/v1/accounts/'.$sub_account_id.'/calls?start_date='.$start_date.'&end_date='.$end_date,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Basic '.$encoded_string,
'Content-Type: application/json'
),
));
I am passing start_date
and end_date
parameters but receiving on first 10 rows. Am I doing something wrong?
Please guide me to this docs if I am doing anything wrong.
2
Answers
You can try sending the parameters in other way i.e.
Your URL looks fine and if you are receiving first 10 rows only then the result is also fine. As per my perception from going through docs. There might be next page url in the response. And you can get all rows by iterating through loop while getting data from next page URL until the end page. You can do something like this
Hope this helps.