Accessing Dashboard URL using Python recipe

Varun017
Varun017 Registered Posts: 5

Hello,

I have a requirement wherein I have to get the URL of the dashboard for a given Dataiku Project through Python recipe.

How can this be done can someone please help me.

Thanks

Varun

Tagged:

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron
    edited July 17

    There are no built-in API methods to get the dashboard URL but this works for me:

    import dataiku
    client = dataiku.api_client()
    project = client.get_project('some_project_key')
    dss_url = client.get_general_settings().get_raw()['studioExternalUrl']
    dashboards = project.list_dashboards()
    for dashboard in dashboards:
        dashboard_url = dss_url + 'projects/' + project.project_key.upper() + '/dashboards/' + dashboard['id'] + '_' + urllib.parse.quote(dashboard['name']) + '/view/'
        print(dashboard_url)
  • Varun017
    Varun017 Registered Posts: 5

    Hi,

    On running the code shared , I am getting the following error.

    Could you please help me here.

    Also for dashboard[ 'id' ] which id do we need to provide.

    It would be nice if you can please clarify on this.

    Thanks,

    Varun

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron

    Upgrade to Dataiku v12.

  • Varun017
    Varun017 Registered Posts: 5
    edited July 17

    Hi,

    Seems like I need admin access to run below code.

    dss_url = client.get_general_settings().get_raw()['studioExternalUrl']

    as I am getting below error

    DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Action forbidden, you are not admin    

Setup Info
    Tags
      Help me…