Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Docs and python redash client are wrong for dashboard API - should be id not slug #657

Open
anshbansal opened this issue May 24, 2022 · 1 comment
Assignees

Comments

@anshbansal
Copy link

Issue Summary

As per https://redash.io/help/user-guide/integrations-and-api/api the dashboard API is /api/dashboards/<dashboard_slug>. But as per the source code https://github.com/getredash/redash/blob/master/redash/handlers/dashboards.py#L155 it takes dashboard_id as parameter. I tested and dashboard_slug causes a 500 error while using dashboard_id gives response.

Steps to Reproduce

  1. Call /api/dashboards/<dashboard_slug> on Redash. Expected dashboard info for dashboard. Actual 5xx error.
           '    return self._get("api/dashboards/{}".format(slug)).json()\n'
           'File "/tmp/datahub/ingest/venv-51a06696-5d1a-44ba-83f1-3ddf66325603/lib/python3.9/site-packages/redash_toolbelt/client.py", line 203, in '
           '_get\n'
           '    return self._request("GET", path, **kwargs)\n'
           'File "/tmp/datahub/ingest/venv-51a06696-5d1a-44ba-83f1-3ddf66325603/lib/python3.9/site-packages/redash_toolbelt/client.py", line 213, in '
           '_request\n'
           '    response = self.session.request(method, url, **kwargs)\n'
           'File "/tmp/datahub/ingest/venv-51a06696-5d1a-44ba-83f1-3ddf66325603/lib/python3.9/site-packages/requests/sessions.py", line 529, in '
           'request\n'
           '    resp = self.send(prep, **send_kwargs)\n'
           'File "/tmp/datahub/ingest/venv-51a06696-5d1a-44ba-83f1-3ddf66325603/lib/python3.9/site-packages/requests/sessions.py", line 645, in '
           'send\n'
           '    r = adapter.send(request, **kwargs)\n'
           'File "/tmp/datahub/ingest/venv-51a06696-5d1a-44ba-83f1-3ddf66325603/lib/python3.9/site-packages/requests/adapters.py", line 510, in '
           'send\n'
           '    raise RetryError(e, request=request)\n'
           '\n'
           "RetryError: HTTPSConnectionPool(host='redash.MASKED_DOMAIN.com', port=443): Max retries exceeded with url: /api/dashboards/sc-metrics "
           "(Caused by ResponseError('too many 500 error responses'))\n"

Technical details:

@susodapop susodapop transferred this issue from getredash/redash Jul 2, 2022
@susodapop
Copy link
Contributor

This is a good report, although technically there still exists an API endpoint that works with the slug. It uses the singular /dashboard API endpoint. It's referenced in the release notes here for V10. We'll update the documentation.

@susodapop susodapop self-assigned this Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants