Skip to main content
Answered

api does not paginate (/contacts)


Forum|alt.badge.img+1

Hi,

I am using the intercom API list all contacts (endpoing /contacts)

The API call responds as expcted with two problems:

  • it ignores the per_page parameter. I tried 1, 5, 11 and other values.
  • It does not paginate, ignoring the starting_after parameter. In the screenshot below please notice that pages.next.starting_after that was returned is the same was as was sent.
  • I tried different API versions, including 2.11 and unstable

 

Postman Screenshot

 

Best answer by Jacques Reynolds

Hey Ben 👋 Jacques here from support engineering.

If you're experiencing issues with pagination, it's possible that there may be a problem with the API or the way the request is being made. Ensure that each page is processed only once and that the requests are correctly formed according to the API's requirements. Also, if the starting_after parameter is the same as the one you sent, it could indicate that there's no further data to fetch or an issue with the API call itself.

When using the Intercom API to list all contacts and you encounter issues with the per_page and starting_after parameters not being respected, ensure that you're using the correct pagination approach. Intercom's API uses a cursor-based pagination system, which means you should use the starting_after attribute provided in the response for subsequent requests. Here's how you can structure your request:

  • Use the per_page parameter to specify the number of records you want per page.
  • Use the starting_after parameter with the value from the previous response to paginate to the next set of records.

For more detailed information on pagination in Intercom's API, you can refer to the pagination documentation.

If the issue persists for you, I would recommend opening a ticket with our support team so that we can dig deeper into the issue for you! :)

 

 

View original
Did this topic help you find an answer to your question?

7 replies

Jacques Reynolds
Intercom Team
Forum|alt.badge.img+4

Hey Ben 👋 Jacques here from support engineering.

If you're experiencing issues with pagination, it's possible that there may be a problem with the API or the way the request is being made. Ensure that each page is processed only once and that the requests are correctly formed according to the API's requirements. Also, if the starting_after parameter is the same as the one you sent, it could indicate that there's no further data to fetch or an issue with the API call itself.

When using the Intercom API to list all contacts and you encounter issues with the per_page and starting_after parameters not being respected, ensure that you're using the correct pagination approach. Intercom's API uses a cursor-based pagination system, which means you should use the starting_after attribute provided in the response for subsequent requests. Here's how you can structure your request:

  • Use the per_page parameter to specify the number of records you want per page.
  • Use the starting_after parameter with the value from the previous response to paginate to the next set of records.

For more detailed information on pagination in Intercom's API, you can refer to the pagination documentation.

If the issue persists for you, I would recommend opening a ticket with our support team so that we can dig deeper into the issue for you! :)

 

 


Forum|alt.badge.img+1
  • Author
  • Active User
  • 13 replies
  • September 6, 2024

HI Jacques,

Doesn’t my screenshot prove the problem? 

Why are we talking in terms of theoretical issues?

 

Thanks,

 

Ben


  • New Participant
  • 1 reply
  • November 22, 2024

I have the exact same problem, on the contacts/search endpoint.  The api completely ignores the starting_after parameter and always gives me the same page of results, I can tell it receives the params I send because if I send a per_page, it complies. It just ignores the starting_after, exactly like the screenshot of the original poster


Forum|alt.badge.img+1
  • Author
  • Active User
  • 13 replies
  • November 22, 2024

@suyapc 
Sorry to hear you’re having the issue.
Notice how Intercom just ignored the screenshot and just gave me generic instructions on how to use pagination.

There was really no recognition and not attempt, as far as I can see, to address the issue. 


Forum|alt.badge.img
  • New Participant
  • 4 replies
  • November 26, 2024

mateusz.leszkiewicz
Intercom Team
Forum|alt.badge.img+5

@Ben Hizak and ​@suyapc It’s Mat from the Support Engineering Team 😀

It looks like a bug on our side, apologies for the confusion here. Please reach out to us to flag this issue, the more reports documenting this issue, the quicker it will be fixed - issue number for reference #361714.


Forum|alt.badge.img+1
  • Author
  • Active User
  • 13 replies
  • November 26, 2024

Hi Maetusz
I apprecaite  you reaching out. 
Please see that I’ve provided proof of error in original post (2 months ago), and the reply was just some copy paste from Deveoper instructions.
Thank you for acknowlaging that there is a real issue. 

Ben


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings