YQL クエリ内で API キーを隠そうとしています。そうするために、私はこの投稿に従ってみました(同じ著者によってここでも説明されています)。URI テンプレートを使用してクエリを実行しようとすると、次の警告が返されます。
"warning": "Missing template variables (BungieAPIKey)"
これが私が取ったステップです:
yql.storage.adminを実行して API キーを保存します。insert into yql.storage.admin (value) values ("set BungieAPIKey='YOUR_KEY' on uritemplate;")- 返された実行キーを使用してコンソールに環境をロードします (
https://developer.yahoo.com/yql/console/?env=store://XXXXXXXXXX) - 走る
select * from json where url in (select url from uritemplate where template='http://bungie.net/videos/{BungieAPIKey}/{user}/{page}' and user='foo' and page='bar')
返される JSON は次のとおりです。
{
"query": {
"count": 0,
"created": "2015-01-13T16:58:57Z",
"lang": "en-US",
"diagnostics": {
"publiclyCallable": "true",
"warning": "Missing template variables (BungieAPIKey)",
"redirect": {
"from": "http://bungie.net/videos//foo/bar",
"status": "301",
"content": "http://www.bungie.net/videos/foo/bar"
},
"url": {
"execution-start-time": "0",
"execution-stop-time": "573",
"execution-time": "573",
"http-status-code": "404",
"http-status-message": "Not Found",
"content": "http://bungie.net/videos//foo/bar"
},
"error": "Invalid JSON document http://bungie.net/videos//foo/bar",
"user-time": "574",
"service-time": "573",
"build-version": "0.2.212"
},
"results": null
}
}
問題を絞り込むために、クリーンな YQL コンソール (環境設定なし) で次のクエリを試しました。
set BungieAPIKey='YOUR_KEY' on uritemplate;
select url from uritemplate where template='http://bungie.net/videos/{BungieAPIKey}/'
これを実行すると、同じ警告が表示されます。テンプレート変数が、環境変数として設定したものからプルされないのはなぜですか?