Skip to main content
Debut
Apr 6, 2020 11:59 AM UTC

Fresh Service tickets API Query based on agents

We are using Fresh Service and we want to get the list of tickets assigned to a specific agent. I looked at Fresh Service v1(https://api.freshservice.com/#view_all_ticket) and v2  (https://api.freshservice.com/v2/#view_all_ticket) api and couldn't find any API.


However Freshdesk has  api's  (https://developer.freshdesk.com/api/#filter_tickets) to query based on agent id.

 I tried calling like  "https://xyz.freshservice.com/api/v2/search/tickets?query="(agent_id:15001150810) AND (status:5) "&order_by=created_at&order_type=asc" and it returned results. However the total number of tickets returned is wrong and it always shows 30 (though there are more tickets) and the pagination also doesn't seem to work. When i append page=2 parameter to the query, it returns same set of results as page=1. So basically i always get the first 30 tickets.


Any solutions on how to make the agent and status based query to work ?

    This topic has been closed for replies.

    3 replies

    Participating Frequently
    Apr 15, 2020 10:30 AM UTC

    Hi Suren,


    API v1 supports fetching of custom ticket views. I would suggest creating a ticket view on the portal of all tickets belonging to a specific agent and using a GET call on the ticket view’s URL.


    API v2 is in beta and enhancements to this section are in progress. We shall pass this as a feature request to our product team for their consideration.


    Best Regards,

    Team Freshservice.

    Debut
    Apr 20, 2020 11:35 PM UTC

    I've been working through the same querying issue (not with agents but same resulting issue) and it seems the pagination 'link' header never gets passed back in the response. Also, have you tried putting a page number higher than 10 in your above attempt? I'm getting a 400 error that the page number should be <=10. So it appears pagination is half-integrated?

    Known Participant
    May 14, 2020 9:23 AM UTC

    Folks,


    Thank you for the feedback. We are looking into bringing more filters for Tickets API. Stay tuned for updates.


    -

    Sundar

    Product @ Freshservice