title: Getting full list of contacts from Hubspot API
body: <p>Hubspot's API allows you retrieve a list of contacts, however it only allows a max of 100 per call. </p>
  
  <p>I do that with this call:</p>
  
  <pre><code>$contacts_batch1 = $contacts-&gt;get_all_contacts(array( 'count' =&gt; '100'));
  </code></pre>
  
  <p>And then if I want to get the next 100 I do this: </p>
  
  <pre><code>$offset1 = $contacts_batch1-&gt;{'vid-offset'};
  
  $contacts_batch2 = $contacts-&gt;get_all_contacts(array('count' =&gt; '100', 'vidOffset'=&gt;$offset1));
  </code></pre>
  
  <p>I am trying to get all the contacts without having to create a new variable each time I want the next 100. My first question would be how would I go about getting the vid-offset of the last set, and then how would I put that as a parameter into the next variable automatically. </p>