この質問は、こちらに投稿された質問と非常によく似ていますが(ただし異なります):https://meta.discourse.org/t/dataexplorer-missing-parameter-when-running-data-explorer-queries-with-params-via-api/223812。
Data Explorerでの私のクエリは次のようになります。
-- [params]
-- topic_id :topic_id
SELECT * FROM posts WHERE topic_id = :topic_id
これはData Explorerでは問題なく動作します。次に、API経由で実行しようとすると、次のエラーが発生します。
{"success":false,"errors":["DiscourseDataExplorer::ValidationError: Missing parameter topic_id of type topic_id"]}
私のPythonリクエストは次のとおりです。
headers = {
'Content-Type': 'multipart/form-data;',
'Api-Key': API_KEY,
'Api-Username': USERNAME_SYSTEM
}
params = {"topic_id": 398}
response = requests.post(url="[REDACTED]/admin/plugins/explorer/queries/10/run", headers=headers, params=params)
エラーから、topic_idを文字列として渡すことはできないと推測しますが、キーとして渡す他の方法が見つかりません。何か考えはありますか?
