Skip to content

IllegalArgumentException while pulling Organization Information #802

@CarlosGarciadeAlba

Description

@CarlosGarciadeAlba

Describe the bug
Several endpoints failing due to an IllegalArgumentException while pulling information from the API.
During my research, I tried to call the https://[domain].zendesk.com/api/v2/organizations.json?page[size]=100 and looks like one of the links at the end of the response is HTML-escaped.

"links": {
        "prev": "https://[domain].zendesk.com/api/v2/organizations.json?page%5Bbefore%5D=[cursor]%3D&page%5Bsize%5D=100",
        "next": "https://[domain].zendesk.com/api/v2/organizations.json?page%5Bafter%5D=[cursor]%3D&page%5Bsize%5D=100"
    }

Specifically, this part:
%3D&page%5Bsize%5D=100

To Reproduce
Steps to reproduce the behavior:

  1. Call any organization-related method with a spliterator and collect to a list:
// api/v2/organizations.json
StreamSupport
     .stream(zendeskClient.getOrganizationMembershipByUser(zendeskUserId).spliterator(), false)
     .collect(Collectors.toList());

// api/v2/organization_memberships.json
StreamSupport
     .stream(zendeskClient.getOrganizationMembershipByUser(zendeskUserId).spliterator(), false)
     .collect(Collectors.toList());

Expected behavior
No exceptions

Current behavior
An exception is thrown
org.zendesk.client.v2.ZendeskException: java.lang.IllegalArgumentException: The URI contain illegal characters: /api/v2/organizations.json?page%5Bafter%5D=[cursor]%3D&page%5Bsize%5D=100

Desktop (please complete the following information):

  • OS: MacOS Sonoma 14.2
  • Java Version 21
  • Spring Boot Version 3.5.6
  • Zendesk Client version 1.1.1, upgraded to 1.4.0 and the issue persists

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