Call DSS HTTP API from DSS Web App

Solved!
ocean_rhythm
Level 3
Call DSS HTTP API from DSS Web App

Hi, I'd like to call the Run Scenario API within a Dataiku Web App, preferably using JS only.

What's the simplest way to do this?


Operating system used: MacOS

1 Solution
HarizoR
Developer Advocate

Hi,

The preferred way to run public API calls from a web app is to go through its Python backend and leverage the Python client (see the doc for specifically running Scenarios).

It is not impossible to call the public API directly in your JS code, however it will require substantial overhead especially regarding authentication. This overhead is bypassed by resorting to the Python backend, which:

  • offers more flexibility out of the box
  • seamlessly authenticates the current DSS user to perform API calls, it also allows to impersonate other users in case you want to implement a delegation scheme (see the security section of the reference documentation).

Hope this helps!

Best,

Harizo

View solution in original post

2 Replies
HarizoR
Developer Advocate

Hi,

The preferred way to run public API calls from a web app is to go through its Python backend and leverage the Python client (see the doc for specifically running Scenarios).

It is not impossible to call the public API directly in your JS code, however it will require substantial overhead especially regarding authentication. This overhead is bypassed by resorting to the Python backend, which:

  • offers more flexibility out of the box
  • seamlessly authenticates the current DSS user to perform API calls, it also allows to impersonate other users in case you want to implement a delegation scheme (see the security section of the reference documentation).

Hope this helps!

Best,

Harizo

ocean_rhythm
Level 3
Author

Thanks, resolved this by using a dashboard with the run scenario and monitor runs components.

Simple and effective! Louis pointed me towards this in an office hour.

0 Kudos

Labels

?

Setup info

?
A banner prompting to get Dataiku