Calling Dataiku Api from Web App

Solved!
AndresSilva
Level 2
Calling Dataiku Api from Web App

Hi!

I have created an API in Dataiku, with the endpoint being a Python Function.

I am able to call the API, from Python, using Dataiku's python 'dataikuapi' package. My calls look like this:

import dataikuapi
#...
apiNode = dataikuapi.APINodeClient(host, serviceID, apiKey)
result = apiNode.run_function(endpoint_id, param1 = "abc",
        param2 = "def",
        #...
        )

resultData = result['response']

 

This works  wonderfully. However, now, I would like to implement the API on a Website. I would like to perform a call to the API from the website and then display the results.

I am using Google's App Scripts, which has a fetch method to perform http/https get requests (Google's documentation ).

Any ideas!?

Thanks!

1 Solution
Andrey
Dataiker Alumni

Hi Andres,

The second way of using Dataiku public API apart from python client is plain HTTP requests.

In your case you could call fetch method provided by Google App with the parameters described here:

https://doc.dataiku.com/dss/api/8.0/apinode-user/#custom-function-endpoints-run-a-python-function-ge...

 

More info about API Node API could be also found here:

https://doc.dataiku.com/dss/latest/apinode/api/user-api.html

 

Regards

Andrey Avtomonov
R&D Engineer @ Dataiku

View solution in original post

2 Replies
Andrey
Dataiker Alumni

Hi Andres,

The second way of using Dataiku public API apart from python client is plain HTTP requests.

In your case you could call fetch method provided by Google App with the parameters described here:

https://doc.dataiku.com/dss/api/8.0/apinode-user/#custom-function-endpoints-run-a-python-function-ge...

 

More info about API Node API could be also found here:

https://doc.dataiku.com/dss/latest/apinode/api/user-api.html

 

Regards

Andrey Avtomonov
R&D Engineer @ Dataiku
AndresSilva
Level 2
Author

Thanks! It worked like a charm.