<?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 Re: Getting duplicate after tokens in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966215#M73099</link>
    <description>&lt;P&gt;I've tried a few things:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding and removing sort&lt;/LI&gt;&lt;LI&gt;Ascending and descending sort&lt;/LI&gt;&lt;LI&gt;Setting the limit or removing to use default&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The pattern goes like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;First GET request returns a handful of messages (with or without setting the limit)&lt;/LI&gt;&lt;LI&gt;First GET request has &lt;STRONG&gt;after&lt;/STRONG&gt; and &lt;STRONG&gt;link&lt;/STRONG&gt; values&lt;/LI&gt;&lt;LI&gt;Second GET request with &lt;STRONG&gt;after&lt;/STRONG&gt; token returns a new token&lt;/LI&gt;&lt;LI&gt;Third GET returns the same result as the second, including the token&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I just noticed seomthing else testing with a new thread id. The second GET results returned an empty array, yet there's a paging link. And the paging link duplicates the second GET request. It's as if there's no results left yet it's setting a paging link anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 20:15:51 GMT</pubDate>
    <dc:creator>MHenderson42</dc:creator>
    <dc:date>2024-04-24T20:15:51Z</dc:date>
    <item>
      <title>Getting duplicate after tokens</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966000#M73079</link>
      <description>&lt;P&gt;I am getting duplicate after tokens when doing GET request to conversation messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;.../conversations/v3/conversations/threads/{threadId}/messages?limit=500&amp;amp;sort=createdAt&amp;amp;after={afterToken}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first request returns a paging similar to above. The first and second requests return new data. Then the paging link is not updated after that and I am getting duplicates returned.&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>Wed, 24 Apr 2024 14:32:55 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966000#M73079</guid>
      <dc:creator>MHenderson42</dc:creator>
      <dc:date>2024-04-24T14:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate after tokens</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966191#M73097</link>
      <description>&lt;P&gt;Hey, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/750956"&gt;@MHenderson42&lt;/a&gt;&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! Thanks for your question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried:&lt;/P&gt;
&lt;UL&gt;
 &lt;LI&gt;Try limiting records to a smaller number, 5 or 10, and see if the issue persists. /conversations/v3/conversations/threads/{threadId}/messages?limit=10&amp;amp;sort=createdAt&amp;amp;after={afterToken}&lt;/LI&gt;
 &lt;LI&gt;If no duplicates are returned, gradually increase the limit (to 50, 100, etc.) until you start seeing duplicates again.&lt;/LI&gt;
 &lt;LI&gt;Another test to try is not passing the after token and see if duplicates start from first request itself or after a few batches.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This will give you a better idea of whether the issue is related to the 'limit' parameter, the 'after' token or is a different issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the additional information! — Jaycee&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 19:53:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966191#M73097</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2024-04-24T19:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate after tokens</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966215#M73099</link>
      <description>&lt;P&gt;I've tried a few things:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding and removing sort&lt;/LI&gt;&lt;LI&gt;Ascending and descending sort&lt;/LI&gt;&lt;LI&gt;Setting the limit or removing to use default&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The pattern goes like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;First GET request returns a handful of messages (with or without setting the limit)&lt;/LI&gt;&lt;LI&gt;First GET request has &lt;STRONG&gt;after&lt;/STRONG&gt; and &lt;STRONG&gt;link&lt;/STRONG&gt; values&lt;/LI&gt;&lt;LI&gt;Second GET request with &lt;STRONG&gt;after&lt;/STRONG&gt; token returns a new token&lt;/LI&gt;&lt;LI&gt;Third GET returns the same result as the second, including the token&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I just noticed seomthing else testing with a new thread id. The second GET results returned an empty array, yet there's a paging link. And the paging link duplicates the second GET request. It's as if there's no results left yet it's setting a paging link anyway.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 20:15:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Getting-duplicate-after-tokens/m-p/966215#M73099</guid>
      <dc:creator>MHenderson42</dc:creator>
      <dc:date>2024-04-24T20:15:51Z</dc:date>
    </item>
  </channel>
</rss>

