aipa
aipa

Reputation: 55

Trying to get report but always just get "ReportDownloadError.MISSING_PARAMETER" "Missing report definition"

I having a trouble with an adwords API and wondering if you can help me.

I called adwords api http:// adwords.google.com/api/adwords/reportdownload/v201603.

This api was working until yesterday, but stop working today.

I read the reference pages and tried to figure out, but so far we only got 'api error' in response.

Here are the links for these pages.

https:// developers.google.com/adwords/api/docs/guides/reporting?hl=en

https:// adwords.google.com/api/adwords/reportdownload/v201603/reportDefinition.xsd

The below is the we wrote,

API_VERSION='v201603'
REQUEST='__rdxml=<reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/'${API_VERSION}'">
    <selector>
      <fields>Ctr</fields>
      <fields>Date</fields>
    </selector>
    <reportName>ACCOUNT_PERFORMANCE_REPORT</reportName>
    <reportType>ACCOUNT_PERFORMANCE_REPORT</reportType>
    <dateRangeType>LAST_MONTH</dateRangeType>
    <downloadFormat>XML</downloadFormat>
</reportDefinition>'

SIZE=${#REQUEST}

echo ${REQUEST} | \
curl -X POST \
    -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
    -H 'Authorization: Bearer '${REFREASH_TOKEN} \
    -H 'developerToken: '${DEVELOPER_TOKEN} \
    -H 'clientCustomerId: '${ACCOUNT_ID} \
    -H 'skipReportHeader: False' \
    -H 'skipColumnHeader: False' \
    -H 'skipReportSummary: False' \
    -H 'includeZeroImpressions: False' \
    -H 'Host: adwords.google.com' \
    -H 'Content-Length: '${SIZE} \
    -H 'Expect: 100-continue' \
    -H 'Connection: Keep-Alive' \
  --data-urlencode @- \
  --verbose \
  https://adwords.google.com/api/adwords/reportdownload/${API_VERSION}

and after executing the code I get the below in response

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportDownloadError>
  <ApiError>
    <type>ReportDownloadError.MISSING_PARAMETER</type>
    <trigger>Missing report definition</trigger>
    <fieldPath/>
  </ApiError>
</reportDownloadError>

I'm hoping if you can give us instruction on how to call report download api.

Thanks in advance,

Upvotes: 1

Views: 838

Answers (1)

aipa
aipa

Reputation: 55

I tried AdWords API client libraries for python. https://github.com/googleads/googleads-python-lib/blob/master/README.md#getting-started

So, I get Wrong error.

Traceback (most recent call last):
  File "examples/adwords/v201607/reporting/download_criteria_report.py", line 61, in <module>
    main(adwords_client)
  File "examples/adwords/v201607/reporting/download_criteria_report.py", line 56, in main
    skip_report_summary=False)
  File "/Users/my/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/googleads/adwords.py", line 1169, in DownloadReport
    output, **kwargs)
  File "/Users/my/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/googleads/adwords.py", line 1439, in _DownloadReport
    response = self._DownloadReportAsStream(post_body, **kwargs)
  File "/Users/my/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/googleads/adwords.py", line 1492, in _DownloadReportAsStream
    raise self._ExtractError(e)
googleads.errors.AdWordsReportBadRequestError: Type: AuthorizationError.USER_PERMISSION_DENIED
Trigger: <null>
Field Path: None

The cause of this problem is create refresh token to users that was deleted.

Registry oauth account. Create refresh token. This problem resolved.

I thank you for reading it through. By now, I guess you get used to my funny English writing.

Upvotes: 1

Related Questions