Google AppsScriptを使用して、1か月間に収入した収入でYouTubeのすべての動画を1枚のシートに並べ替えようとしています。しかし、私は、私はビデオに「寸法」を設定したときにエラーを取得しておいてください。ここではYouTube API - maxResultsが機能しないため、Dimensionとしてのビデオが機能しない
Error:{
"error":{
"errors":[
{
"domain":"global",
"reason":"badRequest",
"message":"The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
}
],
"code":400,
"message":"The query is not supported. Check the documentation at https://developers.google.com/youtube/analytics/v1/available_reports for a list of supported queries."
}
}(line 53,
file "Code",
project "YoutubeAnalytics")
は私のコードです:
var analyticsResponse = YouTubeAnalytics.reportsQuery('channel==' + channelId,
oneMonthAgoFormatted,
todayFormatted,
'views',
{
dimensions:
'video',
maxResults:
5,
sort:
'-views'
});
私は単に「日」または「7DayTotals」に「ビデオ」を変更した場合予想通り、これらはここに記載されている寸法例もあるとして、それは、動作します:https://developers.google.com/youtube/analytics/v1/dimsmets/dims
(興味深いことには、可能なヒントは、「性別」の寸法はいずれも動作しないと '上記と同じエラーがスローされます)
私は、StackOverflowに関する同様の質問を見て、maxResultsを宣言しなければならないことがあり、何らかの理由で私のものが動作していない可能性があると考えています。ディメンションを「日」に設定してもエラーのないレポートを取得しても、maxResultsは決して割り当てられた整数に制限されません。私は30日の範囲があり、それに「日」の次元を与えているので、代わりに30の結果が得られます。
ご協力いただきありがとうございます。
ジャスト追加します動画ディメンションを使用するための具体的なドキュメントへのリンク:https://developers.google.com/youtube/analytics/v1/channel_reports#top-videos-reportsここにすべてのルールを守っているような気がします。 Appsスクリプトのmax-resultsにはmaxResultsと入力してください) – IndieProgrammer