AttributeError: 'list' object has no attribute 'get'
See original GitHub issueI am calling the get_order endpoint like this,
api_response = orders_api.get_orders( CreatedAfter=created_after, CreatedBefore=created_before, NextToken=next_token, )
and it was working very well recently, but now when I call it, I get this error
File "/mnt/c/Users/ayubz/Documents/Amazing Brand/amazon-due-diligence/logic/get_orders.py", line 49, in get_orders api_response = orders_api.get_orders( File "/home/zakir/.local/lib/python3.8/site-packages/sp_api/base/helpers.py", line 21, in wrapper return function(*args, **kwargs) File "/home/zakir/.local/lib/python3.8/site-packages/sp_api/api/orders/orders.py", line 51, in get_orders return self._request(kwargs.pop('path'), params={**kwargs}) File "/home/zakir/.local/lib/python3.8/site-packages/sp_api/base/client.py", line 114, in _request return self._check_response(res) File "/home/zakir/.local/lib/python3.8/site-packages/sp_api/base/client.py", line 118, in _check_response error = res.json().get('errors', None) AttributeError: 'list' object has no attribute 'get'
Any idea why this might be happening?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Ah nice. I was worried that the next token could cause this. Good it’s working!
@saleweaver Yes, you’re right, I had set the AWS_ENV from production to Sandbox by mistake, sorry. Its working now. Thanks for the fast response