06-03-2024 10:54 AM
I am trying to paginate using a POST HTTP CLIENT Snap. I don't know how to accomplish this with the information provided in the data returned. I am extracting data from HubSpot using the 'search' endpoint (https://api.hubapi.com/crm/v3/objects/contact/search). The data returned looks like this:
How do I use this information to configure the snap to paginate?
Please Help!
Solved! Go to Solution.
06-11-2024 08:38 AM - edited 06-11-2024 05:39 PM
@koryknick, Thank you for your help. I was provided a solution by a coworker.
It's essentially that pipeline solution you provided HTTP Client Pagination with a few tweaks. I modified the HTTP Client as follows: Removed pagination configurations and the parameters configurations for both http snaps and added to the body of the 2nd HTTP snap "after" : $splitValue, "limit" : 100 Then I was getting subsequent data. But the data was duplicating. So I modified the map for pagination as follows:
06-06-2024 12:07 PM - edited 06-06-2024 12:07 PM
@snapation6713 - Use the HTTP Client snap in the API Suite snap pack with Request Method = POST. Then you can configure the Pagination section Has Next property as:
$entity.paging.hasPath('next')
Enable the "Reuse request parameters" and set the key appropriate to the API you're calling for the offset (I assume "after"), and I assume the following expression:
$entity.paging.next.after
This may not all be completely accurate as I can't test it, but hopefully it gets you on your way to a solution.
06-10-2024 08:20 AM
Thank you @koryknick, this is the logical thing to do, which I did try and it returned the first 10 records and an error stating the following: get the following errors:
06-10-2024 08:56 AM
In addition when I look at the results the debug section contains the following:
06-10-2024 10:18 AM
@snapation6713 - my apologies - I didn't see that you had referenced the API you're trying to call. Fortunately, I recently worked with the Hubspot API and that one is a bit tricky as it uses a non-standard method to paginate their data. Please refer to our HTTP Client Pagination documentation, which will give clear instructions that should work for this particular API framework.
06-10-2024 12:28 PM - edited 06-10-2024 12:32 PM
@koryknick I did see this solution before and I tried it. I downloaded the sample pipeline and had to make some modifications to the json body by removing the json.stringify and unselecting the '=' and add a header of content-type: application/json and I did get many results and no errors, however the issue here is that it returns a limit of 10 (even though I have the limit set to 100) and it returns the same number of total records and the same first 10 records for all the pages.
This is the debug: