question

sh4kesbeer avatar image
0 Likes"
sh4kesbeer asked

X-EBAY-C-MARKETPLACE-ID is ignored

Hi, I try to search the german ebay but I will always get US results no matter how I set X-EBAY-C-MARKETPLACE-ID. Is this a known issue? A couple months earlier a guy seems to have had the same issue (see this forum) but there was no real solution. Is this a known bug and is there any way to make this work?
browse apimarketplacebrowsemarketplaces
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
Pleas show us some code.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sh4kesbeer avatar image
0 Likes"
sh4kesbeer answered
Hi, thanks for your reply. I do e.g. in the following way: let queryURL = " https://api.ebay.com/buy/browse/v1/item_summary/search?" + "q=abitur" let options = { headers: { "Authorization": "Bearer " + auth_token, "X-EBAY-C-MARKETPLACE-ID": "EBAY_DE", "Accept-Language": "en-US", "Content-Type": "application/json", "Accept": "application/json", "Accept-Charset": "utf-8", "Content-Language": "en-US" } } let itemReq = https.get(queryURL, options, (res) => { var data = null res.on("data", part => { data = data === null ? part : data + part }) res.on("end", () => { let response = JSON.parse(data) resolve(response) }) }) console.log(itemReq) It also does not seem to matter what accept-language or content-language I set...
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
Hmmm... I'm not sure about why, but I wonder if all of those HTML "quot" entities might be getting in the way. For example, you may need to have exactly this syntax: X-EBAY-C-MARKETPLACE-ID: EBAY_DE Notice above the colon, then space, then EBAY_DE . Perhaps also try this (without any "quot"s getting in the way): X-EBAY-C-MARKETPLACE-ID = EBAY_DE
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sh4kesbeer avatar image
0 Likes"
sh4kesbeer answered
Thanks for your reply! As I stated in the comment (which seems to have disappeared mysteriously...) in the code there are no "quot" things these were inserted by this forum to escape the ". The headers are handled by the nodejs api by giving key-values. After all the Authorization part with the bearer token is working (if I remove it the server will complain) so I guess the handling of the headers is correct. I will attach a screenshot of how this looks unescaped in my code as I am a bit frustrated right now... ![alt text][1] [1]: /storage/temp/2051-screenshot-2019-03-26-at-090519.png

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered
I'm not experienced with Javascript. Is the colon and space (": ") in those headers sent in the eBay API request, or are they just delimiters in the code? It might matter for the locale but not for the token.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

spulface avatar image
0 Likes"
spulface answered
Actually, have a try with EBAY-DE instead of EBAY_DE. *Disclaimer: I am an eBay employee but the views expressed on this post are mine and do not necessarily reflect the views of eBay Inc.*
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.