Start a new topic

Api - count of all created tickets

Hi - I already went through the articles that might be related to my problem but couldn't find any solution. 


I simply want to know the count of all created tickets in our support department.

When I'm sending the request https://xxxxxxx.freshservice.com/helpdesk/tickets/view/12345?format=json"


... I only get the first 30 results back. The only possibility I see here is to loop through all pages by using ?page=X - in case the result is again 30 I go with ?page=2 and so on.


The problem here is that I do not know if there is a "next page" if my result is again 30. Could be that there are exact 30 tickets 


But anyway, this isn't really the solution what I am looking for - there must be an easier way since I already see the total count of tickets in the web GUI, in my view!


Maybe I missed something in the Api documentation. help please :-)



Unfortunately I believe that is the only way at the moment.


We have hourly exports setup to import into another system for reporting and we ended up using a custom report which exports to csv which is then automatically processed; otherwise the api limit keeps getting hit if we run through all the pages.


There is version 2 of the api in the pipe line I believe... 

@fs Can you comment on rumors of API v.2?!

O.O

Hi All, 

I hope you might have already noticed, if not we have released API V2 

You can access the document by visiting API V2

@Andreas to answer your question, have you tried "URL?format=json&page=1" in the URL, this help you navigate through pages.

Hope this helps, feel free to reach out for any help.


Jayesh
Freshservice Support 

Hi Jayesh,


thanks for your reply.

As I wrote -

The only possibility I see here is to loop through all pages by using ?page=X - in case the result is again 30 I go with ?page=2 and so on.


That means I loop through the pages until I come to the end. Then just simply multiply Nr. of loops * 30. 
but - this is not accurate enough.  

Correct. The v2 API is not very robust.  It would be nice if we could request aggregate numbers. i.e. total tickets, open ticket, closed tickets, etc and then add filtering like 'last 7 days', last month, etc.

Login or Signup to post a comment
JS Bin