zendesk / zendesk_api_client_php

Official Zendesk API v2 client library for PHP
336 stars 259 forks source link

Can't find tickets by external_id #385

Closed deguif closed 6 years ago

deguif commented 6 years ago

I'm currently using the zendesk api client to find tickets with a specific external id. In my case, when making the query with the client, I got a 400 bad request.

Here the's code: $this->client->tickets()->findMany(['74'], [], 'external_ids')

Which leads to this error: Client error: GET https://xxxx.zendesk.com/api/v2/tickets/show_many.json?external_ids=74 resulted in a 400 Bad Request

For users it works fine but the call is slightly different: $this->client->users()->findMany(['external_ids' => ['74']])

Is there something I'm doing wrong?

Boggimedes commented 6 years ago

Same issue.

joseconsador commented 6 years ago

Hi @deguif

The way to do it would be $this->client->tickets()->findAll(['external_ids' => ['74']]). Let me know if that helps.

Joms

larskoeie commented 6 years ago

Hi @deguif and @joseconsador

Same issue.

This works for me : $client->tickets()->findAll(['external_id' => '74']));

https://developer.zendesk.com/rest_api/docs/core/tickets#list-tickets-by-external-id Probably only possible to fetch by a single external id (which may return multiple tickets).

Lars