<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HubSpot Pagination pattern not supported by Azure Data Factory? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/507384#M47536</link>
    <description>&lt;P&gt;Hi HubSpot!&amp;nbsp; I'm trying to use a Azure Data Factory to incrementally pull data into our SQL database.&amp;nbsp; I found that I can use the V3 Search to find all the contact modified after my last pull which will give me my incremental pull, and I can easily specify the contact properties that I'd like to sync.&amp;nbsp; Now the only problem is when there are over 100 contacts (max limit is 100) I need to page through the result set and ADFv2 doesn't support the pagination pattern on you API call as far as I can tell.&amp;nbsp; Here is the ADFv2 documentation about this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/azure/data-factory/connector-rest?tabs=data-factory#pagination-support" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/data-factory/connector-rest?tabs=data-factory#pagination-support&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now this is what the documentation says:&lt;/P&gt;&lt;P&gt;This generic REST connector supports the following pagination patterns:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next request’s absolute or relative URL = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s absolute or relative URL = header value in current response headers&lt;/LI&gt;&lt;LI&gt;Next request’s query parameter = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s query parameter = header value in current response headers&lt;/LI&gt;&lt;LI&gt;Next request’s header = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s header = header value in current response headers&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And from your site, after is a body parameter.&lt;/P&gt;&lt;P&gt;My question is there any way this could be expanded to be either a query parameter or header to allow integrations with ADFv2?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2021 20:08:55 GMT</pubDate>
    <dc:creator>JBorn</dc:creator>
    <dc:date>2021-10-07T20:08:55Z</dc:date>
    <item>
      <title>HubSpot Pagination pattern not supported by Azure Data Factory?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/507384#M47536</link>
      <description>&lt;P&gt;Hi HubSpot!&amp;nbsp; I'm trying to use a Azure Data Factory to incrementally pull data into our SQL database.&amp;nbsp; I found that I can use the V3 Search to find all the contact modified after my last pull which will give me my incremental pull, and I can easily specify the contact properties that I'd like to sync.&amp;nbsp; Now the only problem is when there are over 100 contacts (max limit is 100) I need to page through the result set and ADFv2 doesn't support the pagination pattern on you API call as far as I can tell.&amp;nbsp; Here is the ADFv2 documentation about this:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/azure/data-factory/connector-rest?tabs=data-factory#pagination-support" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/data-factory/connector-rest?tabs=data-factory#pagination-support&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now this is what the documentation says:&lt;/P&gt;&lt;P&gt;This generic REST connector supports the following pagination patterns:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Next request’s absolute or relative URL = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s absolute or relative URL = header value in current response headers&lt;/LI&gt;&lt;LI&gt;Next request’s query parameter = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s query parameter = header value in current response headers&lt;/LI&gt;&lt;LI&gt;Next request’s header = property value in current response body&lt;/LI&gt;&lt;LI&gt;Next request’s header = header value in current response headers&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And from your site, after is a body parameter.&lt;/P&gt;&lt;P&gt;My question is there any way this could be expanded to be either a query parameter or header to allow integrations with ADFv2?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 20:08:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/507384#M47536</guid>
      <dc:creator>JBorn</dc:creator>
      <dc:date>2021-10-07T20:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Pagination pattern not supported by Azure Data Factory?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/507935#M47568</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/10166"&gt;@johnelmer&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;Once again, mind helping out &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 20:24:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/507935#M47568</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2021-10-08T20:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Pagination pattern not supported by Azure Data Factory?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/510463#M47735</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;Sounds like a question for the HubSpot API devs.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 13:08:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/510463#M47735</guid>
      <dc:creator>johnelmer</dc:creator>
      <dc:date>2021-10-14T13:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Pagination pattern not supported by Azure Data Factory?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/518423#M48244</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/258582"&gt;@JBorn&lt;/a&gt;&amp;nbsp;I'm currently working on a similar implementation and here's how I tackled that problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Define initial variables:&lt;/P&gt;&lt;P&gt;* "After" - 0&lt;/P&gt;&lt;P&gt;* "PagingFound" - true&lt;/P&gt;&lt;P&gt;* "TempPageCount" - 1&lt;/P&gt;&lt;P&gt;* "CurrentPageCount" - 1&lt;/P&gt;&lt;P&gt;* "TotalPageCount" - 0&lt;/P&gt;&lt;P&gt;Until Activity&lt;/P&gt;&lt;P&gt;* Settings -&amp;gt; Expression &amp;gt;&amp;nbsp;@equals(variables('PagingFound'), 'false')&lt;/P&gt;&lt;P&gt;Inside Until Activity&lt;/P&gt;&lt;P&gt;* Copy Data Activity &amp;gt; HubSpot Search API to DataLake&lt;/P&gt;&lt;P&gt;Request method: POST&lt;/P&gt;&lt;P&gt;Request body:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@{concat('{
"limit": ', variables('Limit'), ',
"after": ',variables('After'),',
    "filterGroups": [
        {
            "filters": [
                {
                    "operator": "GTE",
                    "propertyName": "lastmodifieddate",
                    "value": "',variables('LastModifiedDate'),'"
                }
            ]
        }
    ],
  "properties":[',variables('HubSpotContactProperties'),'],
    "sorts": [
        "string"
    ]
}')} &lt;/LI-CODE&gt;&lt;P&gt;Sink: JSON file with FileName appending the CurrentPageCount to create a new file for each batch from HubSpot&lt;/P&gt;&lt;P&gt;On Success for the Copy Data Activity &amp;gt; Lookup Activity to get the First Row only of that file - need to determine if it contains the "paging" object in the JSON.&lt;/P&gt;&lt;P&gt;On Failure for the Copy Data Activity &amp;gt; Set Variable - "PagingFound" = false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On Success for the Lookup Activity &amp;gt; If Condition Activity&lt;/P&gt;&lt;P&gt;*&amp;nbsp;@if(contains(activity('Result count').output.firstRow, 'paging'), true, false)&lt;/P&gt;&lt;P&gt;On Failure for the Lookup Activity &amp;gt; Set Variable - "PagingFound" = false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Condition Activity &amp;gt; True&lt;/P&gt;&lt;P&gt;* Set PagingFound = true&lt;/P&gt;&lt;P&gt;* Set After =&amp;nbsp;@{activity('Result count').output.firstrow.paging.next.after}&lt;/P&gt;&lt;P&gt;* Set TempPageCount =&amp;nbsp;@string(add(int(variables('CurrentPageCount')), 1))&lt;/P&gt;&lt;P&gt;* Set CurrentPageCount = TempPageCount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Condition Activity &amp;gt; False &amp;gt; Set Variable - PagingFound = false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main Pipeline&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KyleParker_1-1635563179034.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/52964i7BA49AFC50AC1153/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KyleParker_1-1635563179034.png" alt="KyleParker_1-1635563179034.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Until Activity&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KyleParker_0-1635563108399.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/52963i5823034F1D572D5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KyleParker_0-1635563108399.png" alt="KyleParker_0-1635563108399.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the Until Activity completes, I reset the page counts,. then iterate over the DataLake files and insert those in my Azure SQL tables. It's a bit of a hack and additional work around, but it was the only way to pass the "After" to the Request Body for the Search API call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions. So far this implementation has worked well for our needs (small delta sets - large datasets of 100K+ records would be pretty brutal using the API, regardless of the implementation).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 03:09:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/518423#M48244</guid>
      <dc:creator>KyleParker</dc:creator>
      <dc:date>2021-10-30T03:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: HubSpot Pagination pattern not supported by Azure Data Factory?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/960983#M72783</link>
      <description>&lt;P&gt;This has been super useful, Thanks Kyle &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 08:40:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/HubSpot-Pagination-pattern-not-supported-by-Azure-Data-Factory/m-p/960983#M72783</guid>
      <dc:creator>JBoon6</dc:creator>
      <dc:date>2024-04-16T08:40:27Z</dc:date>
    </item>
  </channel>
</rss>

