Skip to content
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

Using 'query' parameter with tickets #10

Open
twangi opened this issue Jul 2, 2020 · 1 comment
Open

Using 'query' parameter with tickets #10

twangi opened this issue Jul 2, 2020 · 1 comment

Comments

@twangi
Copy link

twangi commented Jul 2, 2020

When trying to retrieve all open tickets, this statement:

$api->tickets->all(['query'=>'status:2']);

Results in a validation exception. The URL it seems to be attempting to send is made up of these:
[path:GuzzleHttp\Psr7\Uri:private] => /api/v2/tickets
[query:GuzzleHttp\Psr7\Uri:private] => query=status%3A2

So it appears that the colon is encoded by 'Freshdesk-laravel' but the colon does not appear encoded in the FreshDesk documentation example:

'https://domain.freshdesk.com/api/v2/search/tickets?query="status:3%20OR%20status:4"&page=2'

So it looks to me as if the utility is encoding colons when FD does not need it to.

However I can't see an example use of this 'query' parameter in the docs to be able to check whether I am using the syntax that this utility is expecting.

@christoph-werker
Copy link

christoph-werker commented Jul 20, 2023

try $api->tickets->search("status:2");

This should work. But i don't figure out, hot to paginate now.
It should look like this:

curl -v -u APIKEY:X -X GET 'https://URL/api/v2/search/tickets?query="status:3%20OR%20status:4"&page=2'

Source:

public function search(string $filtersQuery)
    {
        $end = '/search' . $this->endpoint();
        $query = [
            'query' => '"' . $filtersQuery . '"',
        ];
        return $this->api()->request('GET', $end, null, $query);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants