Clay Icon

Understanding Pagination for API Contacts in Clay

ยท
ยท

Hey guys, i am struggling to get all of the contacts that I've searched with http api in hubspot crm. I see the total contacts but just getting the 10 results. I saw that we can use pagination but is there a way to loop through the http api column? How do we do that in clay?

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    ๐Ÿ’ค You've caught us outside of our support hours (9am-9pm EST), but don't worry - we'll be back in touch within 24 hours (often sooner!). If you haven't already, please include the URL of your table in the thread below so that we can help you as quickly as possible!

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    Pass a limit param in the body, you can get max of 100 in one call

    {
     "filterGroups": [
     {
     "filters": [
     {
     "propertyName": "associations.company",
     "operator": "EQ",
     "value": "123"
     }
     ]
     }
     ],
     "properties": ["email", "firstname", "lastname", "phone", "jobtitle"],
     "limit": 100
    } 

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    Then if you want to pull next 100 you need to pass after param do this

    
    {
     "filterGroups": [
     {
     "filters": [
     {
     "propertyName": "associations.company",
     "operator": "EQ",
     "value": "123"
     }
     ]
     }
     ],
     "properties": ["email", "firstname", "lastname", "phone", "jobtitle"],
     "limit": 100,
     "after":100
    } 

    and so one.

  • Avatar of Halil F.
    Halil F.
    ยท
    ยท

    Thanks Muhammed, For the second batch do i need to create another column for http api? If not how do i store the values?

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    Yes, you have to create another column

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    OR you can keep editing the same column by changing the parameters (not recommended)

  • Avatar of Halil F.
    Halil F.
    ยท
    ยท

    Is it a good use if i make limit 5000 like a huge number and get all of them at once no need to use another request?

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    Halil F. that is not how API works, it wont return more than 100 at one time regardless you put 5K or 10K in the limit

  • Avatar of Halil F.
    Halil F.
    ยท
    ยท

    Oh i see, it says 200 in the error.

  • Avatar of Halil F.
    Halil F.
    ยท
    ยท

    Than i should make another column or narrow down by filters, thanks

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    Yes, narrow down by filters or make another api call. In this case I think you can get 200 per api call See if you are able to do so.

  • Avatar of Muhammad S.
    Muhammad S.
    ยท
    ยท

    You might hit a clay cell character limit as well if you try to pull 200 contacts as well but see what works with your usecase

  • Avatar of Daniel K.
    Daniel K.
    ยท
    ยท

    Hi Halil! Thanks for jumping in Muhammad! Nice job. If you hit a cell limit, you have to filter for "Field Paths to Return" within the HTTP integration. Let me know the issue still persists and happy to look at it :) https://downloads.intercomcdn.com/i/o/w28k1kwz/1228636804/bbfbc38fab46953ae1c8a9549962/Berrycast_WYidh545DS.png?expires=1729851300&signature=f14fe324162d4ab410aa4e55f696dd4b42e1413d26fe47cea47b6d98b7c8f602&req=dSIlHs99m4lfXfMW1HO4zZiFKd8PIQ1xPzHwYqM9lYjOMspe%2BTn8VtVqz38p%0ADXpL%0A

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    We haven't heard back from you in a bit, so we're going to go ahead and close things out here - feel free to let us know if you still need something!

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    Hi Halil F.! This thread was recently closed by our Support team. If you have a moment, please share your feedback:

  • Avatar of Channeled
    Channeled
    APP
    ยท
    ยท

    Thank you so much for sharing your feedback Halil F.!