I have a question that is very similar to (but different from) the question posted here: `DataExplorer::ValidationError: Missing parameter` when running Data Explorer queries with [params] via API.
My query in Data Explorer looks like this:
-- [params]
-- topic_id :topic_id
SELECT * FROM posts WHERE topic_id = :topic_id
This works fine in Data Explorer. Then, when I try and run it via the API I get:
{"success":false,"errors":["DiscourseDataExplorer::ValidationError: Missing parameter topic_id of type topic_id"]}'
Here is my python request:
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)
I gather from the error than I cannot pass “topic_id” as a string, but I don’t see how else I can pass it as a key. Any thoughts on this?