amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
589 stars 728 forks source link

Cannot query the catalog #4007

Closed gaelayo closed 3 months ago

gaelayo commented 3 months ago

Hello, I am trying to request data from the catalog in a very simple way, with the following Python script:

import requests

query = {
      "marketplaceIds": "ATVPDKIKX0DER",
      "keywords": "shoes"
}

headers = {
        "x-amz-access-token": <REDACTED>,
        "User-Agent": <REDACTED>
    }

items = requests.get("https://sellingpartnerapi-na.amazon.com/catalog/2022-04-01/items", data=query, headers=headers)
print(items)
print(items.content)

However, the output looks like:

<Response [400]>
b'<!DOCTYPE html><html><head><title>x</title></head><body></body></html>\n'

without much details, as you can see.

Could you tell me what is wrong with the previous request ?

harguph commented 3 months ago

Hello,

Per the searchcatalogitems api, I was able to make the call successfully.

Screenshot 2024-07-05 at 12 31 01

It seems the invocation configuration is wrong, please check your requests.get code ( for passing query parameters it must be params= and not data= refer : https://requests.readthedocs.io/en/latest/user/quickstart/#passing-parameters-in-urls )

Regards