Contacts import only showing first 30 entries

  • 21 June 2016
  • 1 reply
  • 42 views


When I do a get to https://company.freshdesk.com/api/v2/contacts I only get the first 30 contacts unless I manually use the per_page parameter.




Also is it possible to export company name in the response not just the company_id?




Code in attached file.




Any help would be much appreciated.


Thanks, Matt



This topic has been closed for comments

1 reply


Yes, the default is 30 results per page, although as you note you can get back upto a 100 using the per_page parameter. You can get the next page of the results using the 'page' parameter.  The 'link' header in the response will hold the next page url if exists. If you have reached the last page of objects, then the link header will not be set. For e.g.




Headers:


"link":< https://domain.freshdesk.com/api/v2/tickets?filter=all_tickets&page=2>;rel="next"




Currently it is not possible to export the company names as part of the contacts API. You will have to use the company API and then make the correlation. However, I do see the use case of having it here. Let me investigate the feasibility of this with the engineering team.