Creating sponsored products reports fails #21
Replies: 3 comments 2 replies
-
Hi Saturn, So in my personal examples to test the same endpoint in the sponsored_brands I have something similar like you:
So according to your code it could be easily solved without modifying the endpoint like this:
How do you think? Kindest regards. |
Beta Was this translation helpful? Give feedback.
-
Ah, good point - that's a good solution indeed! Especially, because it avoids breaking the API of these methods. I still wonder if the method could be more flexible in that it checks the Initially, I was just very confused by the error message saying |
Beta Was this translation helpful? Give feedback.
-
I prefer just a warning style so you could prepare a PR and I will test it. |
Beta Was this translation helpful? Give feedback.
-
Hi! First off: Thanks for this SDK, I very much like it so far!
Describe the bug
Requesting a sponsored products campaigns report fails for me. When building the request myself with
requests
I can get it to work, so it's definitely not an issue with the API or with my credentials.To Reproduce
When I run the following script
I receive the following error:
Expected behaviour
Receive a
202
responseSolution
I managed to find the source of the bug when building my own request with
requests
:Instead of using
request.post
'sdata
parameter, you need to passbody
tojson
.I.e. this line: https://github.com/denisneuf/python-amazon-ad-api/blob/main/ad_api/api/sp/reports.py#L33
needs to be changed to
return self._request(fill_query_params(kwargs.pop('path'), recordType), json=kwargs.pop('body'), params=kwargs)
Then everything should be working fine.
I'm happy to provide a PR to fix this. I wait for a reply here first though ✌️
Beta Was this translation helpful? Give feedback.
All reactions