I can't get the full contact, I can only get the first page

This is my code
image

and it only looks up the list according to page 1 of 30 records
I want to get all the lists?


Hi @Duong_nguyen_hoang1,

Greetings!

You would have to paginate through the contact pages to get all the contacts.

By default, FWs API will provide 30 data per API call.

You can use the below query parameters to set the page number and data length.

per_page => to set the result count per page (max value = 100).
page => to specify the page number.

if you go beyond the total count the API will return the empty array.

So essentially you would have to loop through the pages to get all the data.

Things you would have to consider:

  • API limit.
  • Timeout. (for SIM and invoke)

Sample API: https://domain.freshdesk.com/api/v2/contacts?state=verified&per_page=20

If you need more help on this, feel free to write back :wink:

Thank you.

thank Benny !
I tried and succeeded
but not per_page which is a parameter page
ed: “/api/v2/contacts?per_page=30&page=<%= context.page %>”,

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.