ROWS not returning in Youtube Analytics API?

爷,独闯天下 提交于 2019-11-28 11:04:05

问题


I have made a request to this url: https://www.googleapis.com/youtube/analytics/v1/reports with the metrics: likes and dislikes.

The echoed response:

{
 "kind": "youtubeAnalytics#resultTable",
 "columnHeaders": [
  {
   "name": "likes",
   "columnType": "METRIC",
   "dataType": "INTEGER"
  },
  {
   "name": "dislikes",
   "columnType": "METRIC",
   "dataType": "INTEGER"
  }
 ]
}

Where are the rows and the actual data that i requested? In the documentation this is what is supposed to return when i request data from youtube:

{
  "kind": "youtubeAnalytics#resultTable",
  "columnHeaders": [
    {
      "name": string,
      "dataType": string,
      "columnType": string
    },
    ... more headers ...
  ],
  "rows": [
    [
      {value}, {value}, ...
    ]
  ]
}

But i get no "rows": [] data. Does my account just not have any analytics or did i do something wrong?

If i cange the alt=json to alt=csv i get null returned.


回答1:


From the docs: 'If no data is available for the given query, the rows element will be omitted from the response.'



来源:https://stackoverflow.com/questions/22884183/rows-not-returning-in-youtube-analytics-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!