Open ajtrichards opened 4 years ago
Have you tried sending the roles as an array instead?
$req = Zttp::withHeaders([
'Authorization' => 'Bearer MYTOKEN',
])->get('https://MYSUBDOMAIN.zendesk.com/api/v2/users.json', [
'role' => ['admin', 'agent'],
]);
Those last two examples won't work because they're defining duplicate keys on a PHP array.
I'm trying to use this library to interact with the Zendesk API. Using the following code, I'm requesting the Users endpoint with some query params in the URL
?role[]=agent&role[]=admin
However, when I have this code I get an error response back from Zendesk saying the params aren't correct.
Request to API
Error from API
If I look at the URL which Zttp actually sends it appears as:
https://MYSUBDOMAIN.zendesk.com/api/v2/users.json?role%5B0%5D=admin&role%5B1%5D=agent
I have also tried using:
and
Using this approach, Zendesk get's only one of the parameters. Does anyone have any suggestions how I can get this working? Via the query params is the only way Zendesk will accept.