dosubot[bot] commented on issue #35714:
URL: https://github.com/apache/superset/issues/35714#issuecomment-3428013348
<!-- Answer -->
To generate requests for the Superset dashboard API:
- To list dashboards, send a GET request to `/api/v1/dashboard/` with your
access token in the Authorization header. Example:
```bash
curl -X GET 'http://<superset_host>/api/v1/dashboard/' \
-H 'Authorization: Bearer <access_token>'
```
- To get details for a specific dashboard, use its numeric ID or slug:
```bash
curl -X GET 'http://<superset_host>/api/v1/dashboard/<id_or_slug>' \
-H 'Authorization: Bearer <access_token>'
```
- You can filter, sort, or paginate results using the `q` query parameter
with a JSON-encoded value. For example, to filter dashboards whose title starts
with "Sales":
```bash
curl -G 'http://<superset_host>/api/v1/dashboard/' \
--data-urlencode
'q={"filters":[{"col":"dashboard_title","opr":"sw","value":"Sales"}]}' \
-H 'Authorization: Bearer <access_token>'
```
- The API only returns dashboards the authenticated user has access to. If a
dashboard is missing or you get a 404, it may be due to permissions or the
dashboard not existing. The UI and API may use different permission checks, so
ensure the token has the right access.
- For more endpoints (like getting charts or datasets for a dashboard), see
`/api/v1/dashboard/<id_or_slug>/charts` and
`/api/v1/dashboard/<id_or_slug>/datasets`
[cite](https://github.com/apache/superset/blob/master/tests/integration_tests/dashboards/api_tests.py).
- All requests must include the `Authorization: Bearer <access_token>`
header
[cite](https://github.com/apache/superset/blob/master/superset/dashboards/api.py).
If you need to use filters, ordering, or pagination, encode them as JSON in
the `q` parameter. The API supports a wide range of filters (title, slug, tags,
favorites, created by, certification, etc.)
[cite](https://github.com/apache/superset/blob/master/tests/integration_tests/dashboards/api_tests.py).
Let me know if you need more specific examples!
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do?
[Good](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=great_response)
|
[Irrelevant](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=irrelevant_answer)
|
[Incorrect](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=incorrect_sources)
|
[Verbose](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=too_verbose)
|
[Hallucination](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=hallucination)
| [Report
🐛](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=bug_report)
|
[Other](https://app.dosu.dev/response-feedback/1e0ec559-5f19-4fb9-9cd4-f904f26b022f?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/35714)
--
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]