Manu-toledo commented on issue #33615:
URL: https://github.com/apache/superset/issues/33615#issuecomment-3513563747
Hello everyone,
I'm experiencing the same issue. I’m unable to retrieve chart data from the
Superset API when automating through n8n.
Authentication works correctly, and I can successfully list dashboards and
charts. However, when I try to call the `/api/v1/chart/data` endpoint, I get
the following error:
```
json
{
"errorMessage": "Bad request - please check your parameters",
"errorDescription": "Request is incorrect: {'': ['Unknown field.']}",
"errorDetails": {
"httpCode": "400"
}
}
```
The request is being sent as a `POST` with the correct headers
(`Authorization`, `X-CSRFToken`, and `Content-Type: application/json`), but the
body is currently empty (`{}`).
It seems that Superset expects a valid `query_context` JSON object as the
request body for this endpoint.
My workflow in n8n looks like this:
1. Get dashboard charts → `GET /api/v1/dashboard/{dashboard_id}/charts`
2. Get chart metadata → `GET /api/v1/chart/{chart_id}`
3. Try to fetch chart data → `POST /api/v1/chart/data`
The issue appears to be that the `query_context` field returned from
`/chart/{id}` must be parsed and sent as the request body in the `/chart/data`
call.
If anyone has a working example or can confirm the correct `query_context`
structure expected by `/api/v1/chart/data`, I’d really appreciate it.
I’m using **n8n v1.107.4 (self-hosted)** with **Apache Superset**.
> Additional note: some charts (especially imported ones) may not have a
`query_context` saved, which leads to this issue even when the API calls are
correct. Opening and saving the chart manually in the UI usually resolves that.
Thanks in advance for any insights or examples!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]