-
Notifications
You must be signed in to change notification settings - Fork 255
Open
@edruid
.
Description
When trying to do foreach ($zendesk->helpCenter->sections()->iterator() as $section)
I get the error
Zendesk\API\Exceptions\ApiResponseException Client error: `GET https://<subdomain>.zendesk.com/api/v2/help_center/sections.json?page%5Bsize%5D=100&page%5Bafter%5D=aQQAAAAAAAAAZFh7/mcAAAAAaR13Wko+GAAA` resulted in a `400 Bad Request` response:
{"errors":[{"code":"InvalidPaginationParameter","title":"Invalid cursor"}]}
[details] {"errors":[{"code":"InvalidPaginationParameter","title":"Invalid cursor"}]}.
If I urlencode
the page[after]
value I get a working response. Or adding urlencode
on this line
$result = isset($this->afterCursor) ? ['page[after]' => $this->afterCursor] : [];
This is likely a more widespread problem, so might want to look at encoding all query params sent to Zendesk\API\HttpClient::get
, but that would be a breaking change since that is a public method.
An entirely different approach would be to use the meta.next
value in the response instead of the meta.after
value.
Metadata
Metadata
Assignees
Labels
No labels