Api 2.0 Contacts pagination contains duplicate values

Hello,
i am trying to go through all results to get all contacts but when using pagination i am getting duplicated contacts and when pages are over some results are missing.

The first query is https://api.intercom.io/contacts/per_page=2

The result contains contacts with ids:
5e3a8503a1843dbfd8ad8a8a
5e383cdee40bdeba5ec3add4

Pages class contains
page=1
starting_after=WzAsIjVlMzgzY2RlZTQwYmRlYmE1ZWMzYWRkNCIsMl0=

So the next query i do is
https://api.intercom.io/contacts/?starting_after=WzAsIjVlMzgzY2RlZTQwYmRlYmE1ZWMzYWRkNCIsMl0%3D&per_page=2

And results that are returned are
5e3838ca73787b96be83611a
5e383cdee40bdeba5ec3add4 - is already duplicate

Pages class contains
page=2
starting_after=WzAsIjVlMzgzY2RlZTQwYmRlYmE1ZWMzYWRkNCIsMl0=

Next query
/contacts/?starting_after=WzAsIjVlMzgzY2RlZTQwYmRlYmE1ZWMzYWRkNCIsM10%3D&per_page=2

And results that are returned are
5e3838ca73787b96be83611a - identical to previous result
5e383cdee40bdeba5ec3add4 - identical to previous result

Pages class contains
page=3
starting_after=WzAsIjVlMzgzY2RlZTQwYmRlYmE1ZWMzYWRkNCIsNF0=

So page number is actually changes to correct ones in pages class.
Results are repeated and starting_after is changed only after 3rd request.

Do i do something incorrectly?
What would be the best way to get all contacts without duplication?

Thank you!

Hey There! :wave:

This one will require some investigation by our engineers and they may need access to your workspace.

Could you reach out to us on the messenger?

Thanks!

Hello,

I do have exactly the same problem.

At first, “starting_after” returns me the base64 encoding of [LARGE_INTEGER_ID?,"<NEW_PAGING_TOKEN>",PREVIOUS_PAGE+1] (I am not sure what the first parameter is supposed to be)

Then after about 80 pages, the “starting_after” response element turns to: [0,"<SAME_AS_PREVIOUS_TOKEN>",PREVIOUS_PAGE+1]. So I see that the page number element continues to iterate, but I keep getting the same results over and over.