Search code examples
google-apireportdouble-click-advertising

How to get data from DoubleClick view using API?


I need to find view by name (or recreate it), request file and download it. Via GUI, I can do it all right:

Screenshot

Sadly, I don't know how to get it by API. Looks for me that I need keyword report, because Keyword column is most important for me, as it allows me to connect entries to Facebook report.

Now, this views are not DFA reports, because dfareporting.reports.list returns:

{
 "kind": "dfareporting#reportList",
 "etag": "\" some etag I won't share \"",
 "nextPageToken": "",
 "items": [
 ]
}

Empty list. So if there are reports, they are not shared with me. Yes, app is using my profile ID, the same one I use to view stings in GUI.

So, I may try to create report with data I need using dfareporting.reports.insert, but then for both "type":"keyword" and "type":"keywords" I get:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid value for: keywords is not a valid value"
   }
  ],
  "code": 400,
  "message": "Invalid value for: keywords is not a valid value"
 }
}

I could try methods from dfareporting.ads set, but keywords are set on ad groups / ad sets (sadly, it was communicated to me in my native tongue, not in English), not on ads directly, so this is no help for me.

How can I get this data via code? What am I missing? It seems to be something big and obvious.


Solution

  • Check this report for seller:

    GET https://www.googleapis.com/adexchangeseller/v2.0/accounts/accountId/reports
    

    Path parameters

    • accountId | string | Account which owns the generated report.

    Required query parameters

    • endDate | string | End of the date range to report on in "YYYY-MM-DD" format, inclusive.
    • startDate | string | Start of the date range to report on in "YYYY-MM-DD" format, inclusive.

    Optional query parameters

    • dimension | string | Dimensions to base the report on.
    • filter | string | Filters to be run on the report.
    • locale | string | Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
    • maxResults | unsigned integer | The maximum number of rows of report data to return. Acceptable values are 0 to 50000, inclusive.
    • metric | string | Numeric columns to include in the report.
    • sort | string | The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
    • startIndex | unsigned integer | Index of the first row of report data to return. Acceptable values are 0 to 5000, inclusive.