I need to create and run some queries as well as get the last reports via DoubleClick Bid Manager API in python, after following the example get_last_report.py in Github step by step, I always got an HttpError 500, like:
Traceback (most recent call last):
File "dbm.py", line 202, in <module>
main(util.setup(args), args.output_directory, QUERY_ID, args.report_window)
File "dbm.py", line 154, in main
response = doubleclick_bid_manager.queries().listqueries().execute()
File "//anaconda3/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "//anaconda3/lib/python3.7/site-packages/googleapiclient/http.py", line 856, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 500 when requesting https://www.googleapis.com/doubleclickbidmanager/v1.1/queries?alt=json returned "Backend Error">
Also when I tried to run the example download_line_items.py, I got another error HttpError 403:
Traceback (most recent call last):
File "download_LI.py", line 81, in <module>
main(util.setup(args), path, request_body)
File "download_LI.py", line 57, in main
handler.write(request.execute()['lineItems'].encode('utf-8'))
File "//anaconda3/lib/python3.7/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "//anaconda3/lib/python3.7/site-packages/googleapiclient/http.py", line 856, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/doubleclickbidmanager/v1.1/lineitems/downloadlineitems?alt=json returned "You are not authorized to use DoubleClick Bid Manager API. Please contact [email protected].">
I already tried different client secret files, but it didn't work. Any help will be appreciated.
Problem resovled, the account we connecte need access to DBM. Just need to add the google connection account to DBM for all service operation.