Dificulty with post_report #142
Replies: 2 comments
-
Try this request: group_by: str, Is a list not str ["advertiser"],
Let me know if it works for you. If not, post the full code with imports, activate Debug and let me know the api version you are using. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Actually I missed the .env file to set AWS_ENV = PRODUCTION. Also I needed to pass the body inside a json.dumps() result = client.post_report(body=json.dumps(req_body)) With that i was able to post the reports and get the responses. Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey, been trying to use the post_report method and getting the error:
File "...\sync_ads_data.py", line 130, in <module> sync_local_ads_files() File "...\sync_ads_data.py", line 117, in sync_local_ads_files report_file = download_report_to_csv( ^^^^^^^^^^^^^^^^^^^^^^^ File "...\ads_reports.py", line 67, in download_report_to_csv result = client.post_report(body=req_body, debug=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\ad_api\base\helpers.py", line 21, in wrapper return function(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\ad_api\api\reports.py", line 38, in post_report return self._request(kwargs.pop('path'), data=kwargs.pop('body'), params=kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\ad_api\base\client.py", line 278, in _request return self._check_response(res) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\ad_api\base\client.py", line 300, in _check_response data = json.loads(str_content) ^^^^^^^^^^^^^^^^^^^^^^^ File "...\Python311\Lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\Python\Python311\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\Python311\Lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Here's my code:
Any ideas on why it is happenning? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions