Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Getdata value "after" not URL encoded #560

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /