Skip to content

Query parameter too long - actually 149 chars #40

@trobert2

Description

@trobert2

I'm getting an error querying the partner api. The error suggests that the query is too long but it actually isn't

query used and it's length:

>>> len("Centre historique de Rome, les biens du Saint-Siège situés dans cette ville bénéficiant des droits d'extra-territorialité et Saint-Paul-hors-les-Murs")
149

Response (400 http error):

{
    "descriptor": "GetYourGuide AG",
    "apiVersion": "1",
    "method": "getTourByQueryAction",
    "date": "2023-02-03T05:56:43Z",
    "status": "ERROR",
    "query": "categories%5B0%5D=1&cnt_language=fr&cond_language%5B0%5D=en&cond_language%5B1%5D=de&cond_language%5B2%5D=fr&currency=EUR&limit=10&q=Centre%20historique%20de%20Rome%2C%20les%20biens%20du%20Saint-Si%C3%A8ge%20situ%C3%A9s%20dans%20cette%20ville%20b%C3%A9n%C3%A9ficiant%20des%20droits%20d%27extra-territorialit%C3%A9%20et%20Saint-Paul-hors-les-Murs&rating%5B0%5D=3&sortdirection=DESC&sortfield=popularity",
    "errors": [
        {
            "errorCode": 903,
            "errorMessage": "Query parameter too long (> 150)."
        }
    ],
    "helpURL": "https://api.getyourguide.com/doc"
}

I think this might be one of 2 issues, since our query string is 149 chars long:

  1. you measure the length of the URL encoded string (this is not clear in the docs if it is so)
  2. GYG does not use utf8 so characters like è end up to be more than one character after decoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions