API Search/tickets

Hi the Team,

I use the api for seach/tickets

/api/v2/search/tickets?query=“type:‘Ticket’ AND status: 2”

I do have a result :
“results”: [
{
“cc_emails”: [],
“fwd_emails”: [],
“reply_cc_emails”: [],
“ticket_cc_emails”: [],
“ticket_bcc_emails”: [],
“fr_escalated”: false,
“spam”: false,
“email_config_id”: 202000054132,
“group_id”: 202000154165,
“priority”: 1,
“requester_id”: 202016970178,
“responder_id”: 202008071388,
“source”: 3,
“company_id”: null,
“status”: 2,
“subject”: “TEST Stéphane”,
“association_type”: null,
“support_email”: null,
“to_emails”: null,
“product_id”: 202000021097,
“id”: 62092,
“type”: “Ticket”,
“due_by”: “2026-05-05T15:30:00Z”,
“fr_due_by”: “2026-05-05T15:30:00Z”,
“is_escalated”: false,
“description”: “<div style="font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif; font-size:14px">\n<div dir="ltr">Test pour la recherche de ticket via l’API.</div>\n<div dir="ltr"></div>\n<div dir="ltr"></div>\n<div dir="ltr"></div>\n<div dir="ltr"></div>\n<div dir="ltr">Ici 000034567890</div>\n</div>”,
“description_text”: “Test pour la recherche de ticket via l’API. Ici 000034567890”,
“custom_fields”: {
“cf_catgorie”: “Autre”,
“cf_souscatgorie”: “Autre”,
“cf_nom_du_client”: “Stef”,
“cf_numro_dabonn”: “000”,
“cf_date_du_rdv”: null,
“cf_positionnement_march”: null,

I have a custom field: cf_nom_du_client

When searching for it as follows:

/api/v2/search/tickets?query=“type:‘Ticket’ AND status: 2 AND cf_nom_du_client:‘Stef’”

it works

but if I put the custom field as follows, I get 0 results:

{
“results”: [],
“total”: 0
}

Who would be the reason why this isn’t working?

best regard,
Stéphane

Hey @Steph78160
there’s this section in API documentation:

So using “custom_string” could be worth trying.

Best

Thomas

Thank you thoma, I’ll check.
best regard.

That’s right, many thanks Thomas :+1:

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