Query string in Catalog List Items returning Invalid Control Character response #71
-
Hi, I'm trying to use the Catalog().list_items endpoint, and am getting the following error when my query string includes blank spaces: "json.decoder.JSONDecodeError: Invalid control character at: line 4 column 197 (char 218)" I've been experimenting with various query strings, and have found that including blank spaces is causing the error. If I use comma separated keywords, I can get a response. I also can get a response if I join keywords with a "+" character. Unfortunately, neither of these approaches returns the result I'm expecting when I search Seller Central's Catalog manually. Below are the examples of query strings I've tried. Query Strings searching for lego set number 10270 Search String More simply stated, I would like to use a search query string that replicates the same results I'm seeing in Seller Central when I search the catalog. Below is my code: from sp_api.api import Catalog print('Start API') QueryString = str('lego 10270') print(QueryString) Response = Catalog().list_items(MarketplaceId = Marketplace, Query = QueryString, QueryContextId = QueryContext) print(Response.payload) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Thank you for bringing this up. The endpoint is now fixed to allow spaces in Query. The wrapper doesn't alter the response in any way and there's nothing I can do about the other questions raised. |
Beta Was this translation helpful? Give feedback.
-
Hi, Marketplace = str('ATVPDKIKX0DER') the request url is encoded with a + instead of the %20 in place of the space: Thanks a lot for your help Guido |
Beta Was this translation helpful? Give feedback.
-
You are the best! |
Beta Was this translation helpful? Give feedback.
Thank you for bringing this up. The endpoint is now fixed to allow spaces in Query.
The wrapper doesn't alter the response in any way and there's nothing I can do about the other questions raised.