-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter and search request #217
Comments
Hi Rafael, try created_at>2015-01-01 Em 26/10/2015 10:50, Rafael Foster notifications@github.com escreveu: How do I filter the request? Ticket create more than 2015-09-01 and less than 2015-10-01; How can I do that? And the search API is not documented, how do I use it? I appreciate that! Reply to this email directly or view it on GitHub: |
I've done this befere without success. If try this codes bellow: $tickets = $zendesk->tickets()->findAll(["created_at" => "2015-01-07", "organization_id" => $orgID]); and $tickets = $zendesk->tickets()->findAll(["created_at>2015-01-07", "organization_id" => $orgID]); also $tickets = $zendesk->tickets()->findAll(["created_at>2015-01-07"]); print_r($tickets); It returns me all tickets, like: Any idea? |
Hi rafael, Date: Mon, 26 Oct 2015 08:23:05 -0700 I've done this befere without success. The organization field is being filtered perfectly, but creation date doesn't. If try this codes bellow: $tickets = $zendesk->tickets()->findAll(["created_at" => "2015-01-07", "organization_id" => $orgID]); and $tickets = $zendesk->tickets()->findAll(["created_at>2015-01-07", "organization_id" => $orgID]); also $tickets = $zendesk->tickets()->findAll(["created_at>2015-01-07"]); print_r($tickets); .... It returns me all tickets, like: [created_at] => 2015-06-03T13:52:39Z [updated_at] => 2015-07-17T20:05:29Z [type] => problem [subject] => "loren ipson" etc.... Any idea? — |
Thanks for your response @RaFeNiX Unfortunally, it still not working. I've copied your entire line and add it to my code. But it return this: Zendesk\API\Resources\Core\Search Object
|
try this simple code. include("./vendor/autoload.php"); $tesrte = $client->search(['query'=>"type:ticket created_at>2015-10-20"]); echo json_encode($tesrte); |
On version 2 of the client things have changed quite a bit. To achieve what you want, you would want a snippet like
Search is now a resource you can make calls on, similar to a ticket or a user. We wanted to keep this pattern consistent. There definitely should be an example on search, will put that in the list of things to do. For more documentation on using search there is https://developer.zendesk.com/rest_api/docs/core/search and https://support.zendesk.com/hc/en-us/articles/203663226 And a pro tip to test your query string easily is to try it out in the zendesk ui. It also seems like you are using the version 1 way of making a search, if you are upgrading, there is a handy upgrade guide that can help you upgrade. Please let me know if this works. |
Yeah! That's working now @miogalang I really appreciate that! Thanks for your help too @RaFeNiX |
Hey, am using php curl to execute my search query but It returns null everytime. Below is a snippet of my code: $date="2018-09-01";
$link = $output->next_page; What am I doing wrong? |
Hi There,
How do I filter the request?
I want to filter tickets creating (greather than) date like:
Ticket create more than 2015-09-01 and less than 2015-10-01;
How can I do that?
$tickets = $zendesk->tickets()->findAll(["created_at" => "2015-09"]);
And the search API is not documented, how do I use it?
There's some documentation to guide me?
I appreciate that!
The text was updated successfully, but these errors were encountered: