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¤cy=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:
- you measure the length of the URL encoded string (this is not clear in the docs if it is so)
- GYG does not use utf8 so characters like
è end up to be more than one character after decoding
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:
Response (400 http error):
I think this might be one of 2 issues, since our query string is 149 chars long:
èend up to be more than one character after decoding