Iam trying to migrate from V1 to V2 of the YouTubeAnalytics API. But I cannot figure out the format in which I should state the query.
Code Iam trying to run:
return analytics.reports().query()
.setIds(id)
.setMetrics("views")
.setDimensions("video")
.execute();
But I get error code 400 like below:
IOException: 400 Bad Request
com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Could not parse content (CNHFwpxMq_TDnbpX_3GdjueOg) of field ids.",
"reason" : "badRequest"
} ],
"message" : "Could not parse content (CNHFwpxMq_TDnbpX_3GdjueOg) of field ids."
}
Any suggestions?