Answered

How can I filter the contacts created after a certain date and, if I have more than one page, scroll through them?

  • 1 February 2023
  • 4 replies
  • 66 views

According to the documentation I can only filter and get data from the first page or get all data without filter.

But, for example, I made a I posted the request at https://api.intercom.io/contacts/searchand it returned me that I have 8 pages with 50 contacts each, and that they were created with a certain date. But I can only access the data from page 1.

So I tried to use the post request to https://api.intercom.io/contacts?per_page=150to be able to reproduce the json that you demonstrate in https://developers.intercom.com/intercom-api-reference/reference/ -cursor paging. But instead of the 8 filtered pages it goes to 62 unfiltered pages.

icon

Best answer by Oseas 3 February 2023, 18:45

View original

4 replies

Userlevel 1
Badge +3

Hi @user1631​ 

 

Can you try if the following URL works for your case?

https://api.intercom.io/contacts?per_page=50amp;starting_after=<date>

This is a way to use the cursor-based pagination with the "per_page" and "starting_after" parameters in an effective way. Hope it works!

 

https://developers.intercom.com/intercom-api-reference/reference/pagination-sorting-search#pagination/p>

Hi @user1911​ ! Thanks for the reply!

To use this URL do I use post or get method? I tried both, but neither worked.

Hey @user1631​! Oséas here from the Customer Support Specialist team 🕵️

 

You should be using POST requests for search resources. Could you please ensure you're applying the correct parameters described here? Just so you know, the starting_after refers to the next value provided in the response to queries with multiple pages, and this parameter is not required when it's not provided.

Thank U @user1911​ @oseas​ . Your tip helped a lot!

Reply