Oct 11, 20216:01 AM - edited Oct 11, 20218:53 AM
Contributor | Elite Partner
How to loop through all offsets en get all results from HubSpot
SOLVE
I fixed the problem with the while loop :
$offset = 0;
$hasMore = true;
while ($hasMore === true) {
//Add the API call in the while loop with the $offset in the url
$url = "https://api.hubapi.com/deals/v1/deal/paged?Associations=true&limit=250&offset=".$offset."&hapikey=" . $api_key;
$offset = $result_back['offset'];
$hasMore = $result_back['hasMore'];
}
Oct 11, 20216:01 AM - edited Oct 11, 20218:53 AM
Contributor | Elite Partner
How to loop through all offsets en get all results from HubSpot
SOLVE
I fixed the problem with the while loop :
$offset = 0;
$hasMore = true;
while ($hasMore === true) {
//Add the API call in the while loop with the $offset in the url
$url = "https://api.hubapi.com/deals/v1/deal/paged?Associations=true&limit=250&offset=".$offset."&hapikey=" . $api_key;
$offset = $result_back['offset'];
$hasMore = $result_back['hasMore'];
}