node.jsgoogle-api-nodejs-clientgoogle-apis-explorerdouble-click-advertising

Display video 360 nodejs api createquery not taking params passed


I have the following code, trying to create a query using nodejs googleapis.

let display360 = google.doubleclickbidmanager({
    version: "v1",
    auth: oauth2Client
});

let advertisersParams = {
    "metadata": {
        "dataRange": "LAST_90_DAYS",
        "title": "Advertisers List",
        "sendNotification": false,
    },
    "params": {
        "type": "TYPE_GENERAL",
        "filters":[{
            "type": "FILTER_PARTNER",
            "value": "xxxxxxx"
        }],
        "includeInviteData": false,
        "groupBys": ["FILTER_ADVERTISER"],
        "metrics": ["METRIC_IMPRESSIONS"]
    },
    "schedule": {
        "frequency": "ONE_TIME"
    }
};

display360.queries.createquery(advertisersParams, function(error, response){

    if(error){
        console.log(error)
    }

    if(response){
       console.log(response)
    }
});

The advertisersParams value is taken directly from the Google API Explorer and it works properly but using the same params on the API call, it fails and reports that schedule, metadata, and params are required, which puzzles me since I've passed them above as advertisersParams, am I passing them wrong or this could be a bug of some kind??


Solution

  • The issue got resolved on the GitHub page, turns out the params I am passing need to be wrapped in a requestBody object, check out the answer here