Skip to content

Restrict number of IDs allowed in GET requests #178

Closed

Description

@steveh

If you specify a large number of, for example, invoice IDs in xero_client.accounting_api.get_invoices you will hit either a 414 or 400 error due to the request URI being too long.

Specifically with 220 IDs we get a HTML 400 error from Akamai, with 210 IDs we get an XML 414 error from Xero, and with 200 IDs we get success.

I think this SDK should either immediately raise an error if you try and request more than say 100 IDs, or better, paginate the requests itself. Or better still, update the API to support these kind of bulk requests with a POST that would not have a URI length restriction.

Activity

  1. self-assigned this
    on Jun 21, 2021
  2. SerKnight commented on Jun 21, 2021

    @SerKnight
    Contributor

    Hi Steveh.

    This is a good idea. I've dealt with the URL string exceeding browser limits and it is not clear at first.

    In the near term I think putting in clearer SDK errors to limit the user from passing the url limits will be more feasible then new post endpoints, but agreed that is likely the better option, using a POST body.

    Feel free to post back ideas you have on how to best solve and will do some more thinking on this, as it is an edge case issue that effects all 6 of our supported SDKs.

  3. locked and limited conversation to collaborators on Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions