Freshdesk search API : retrieve by "to" field

Hello,

We have a support desk with 2 incoming emails : email@company1.com and email@company2.com

I am trying to use the https://ucpa.freshdesk.com/api/v2/search/tickets?query= endpoint to retrieve emails only for company 2.

I have tried “to”, “support_email” to no avail, I always get the following error:

{
    "description": "Validation failed",
    "errors": [
        {
            "field": "to",
            "message": "Unexpected/invalid field in request",
            "code": "invalid_field"
        }
    ]
}

According to the ticket API attributes
The field would be named to_emails

to_emails	Array of strings	Email addresses to which the ticket was originally sent

However, I would question should you be using 2 different emails or should you be using multiple products?

This might make things a lot easier on you if there are multiple differences in how you handle the tickets between the 2 emails.

1 Like

Hey There,

@Christian_Brink - I am not sure if that helps.
Neither the List All Tickets nor the Filter Tickets endpoint supports products.

Or did I miss something?

The latter would at least support tags or custom_fields, so you could tag your tickets or set a custom field accordingly and filter for tags or custom fields.

Not the best solution of it all, as I’d expect product_id as a filter option OOTB.
At least it would work I guess.

But keep in mind, that you can only fetch up to 300 tickets with the filter tickets API.

Best Tom

1 Like

That was more of a general suggestion. If you’re segmenting the tickets by incoming emails then multiple products might help.

You can have separate portals, SLAs and Automations based on the Product.

1 Like