How can I get the requester details filter ticket results

Hi,
I want to get active tickets via api that are from a specific requester email.
Using the filter tickets api i execute the following:

https://devtesting2.freshservice.com/api/v2/tickets/filter?query="status:2 OR status:3"

The returning JSON contains an requester ID which doesn’t correlate to the ID of a requester in my freshservice environment.

Can you advise what I need to do to get this additional detail in the JSON response?
What is even more confusing is that the ID given in the ticket response cannot bee seen in the admin interface in Freshservice (21000006247), the requester in this instance is an Agent. Is something odd going on here?

{
    "tickets": [
        {
            "subject": "test 1406-1223",
            "group_id": null,
            "department_id": null,
            "category": null,
            "sub_category": null,
            "item_category": null,
            "requester_id": 21000006247,
            "responder_id": null,
            "due_by": "2022-06-23T21:00:00Z",
            "fr_escalated": false,
            "deleted": false,
            "spam": false,
            "email_config_id": null,
            "fwd_emails": [],
            "reply_cc_emails": [],
            "cc_emails": [],
            "is_escalated": false,
            "fr_due_by": "2022-06-16T18:00:00Z",
            "priority": 1,
            "source": 3,
            "status": 2,
            "created_at": "2022-06-14T11:23:24Z",
            "updated_at": "2022-06-14T11:23:24Z",
            "requested_for_id": 21000006247,
            "to_emails": null,
            "id": 6,
            "type": "Incident",
            "description": "<div style='font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;'>\n<div>test</div>\n</div>",
            "description_text": "test"
        }
	],
    "total": 1
}

Hi @dawsonweb

You can use view all tickets API to fetch tickets for specific requester.
For example :

https://{{freshserviceurl}}/api/v2/tickets?email=sachin.kumar1@freshworks.com&filter=new_and_my_open&include=requester
or
https://{{freshserviceurl}}/api/v2/tickets?requester_id=27000458106&filter=new_and_my_open&include=requester

2 Likes

Thanks Sachin. This is interesting. I figure it would be cheaper (credit wise) if I could get the “requester_id” value for the requester I want to filter by and negate having to do the additional includes. Then add that id into the iparams for the app to work.
But… as I said earlier, the id in the FS admin backend does not correspond to that given on the API ticket response

"requester_id": 21000006247,

Hi Michael,

Based on my understanding requester id is created whenever a request is raised by someone. It can be an agent who had raised some request. This is not same as agent id which you can see on UI. However if you use View Requester with the id returned, you can see its the same user but as requester. There will be flag “is_agent” true for this user.

Hope this clarifies the confusion.

1 Like

Thank you Sachin, your original hint got me there…

curl -v -u user@yourcompany.com:test -X GET 'https://domain.freshservice.com/api/v2/tickets?email=super%2Bman%40gmail.com'

taken from:
Service Desk API for Developers | Freshservice

1 Like

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