API Call and SQL Query

Solved!
StephenPegg
Level 2
API Call and SQL Query

Hi,

I have a scenario where I am trying to use an enrichment dataset on an endpoint. My endpoint is a model that returns a ML prediction. For the model to be called, I first need to enrich my data.

My enrichment dataset is a SQL query which takes in a single id in the where clause and returns lots of other data.

At the moment, I have a global variable that I use to pass the single id into my SQL query and it works fine.

What I am trying to do is use the id that is passed on my API call to filter my SQL query. Is this possible?

e.g. API call with id 1234, enrichment SQL query contains clause where id = 1234, my data gets returned which is subsequently passed to a ML model which returns a prediction.

Does anybody have any ideas?

Thanks

0 Kudos
1 Solution
Manuel
Dataiker Alumni

Hi,

So it seems that you need an endpoint coordinating the call of other endpoints, as described on this page: https://doc.dataiku.com/dss/latest/apinode/api/endpoints-api.html

Good luck

View solution in original post

4 Replies
Manuel
Dataiker Alumni

Hi,

Does this page answer your question? https://doc.dataiku.com/dss/latest/apinode/endpoint-sql-query.html

I hope this helps.

0 Kudos
StephenPegg
Level 2
Author

Manual,

Thanks for this and I did see this one. I need to modify my original message to mentioned that once the data is returned by the endpoint enrichment, a model is called and a prediction returned.

The endpoint is not returning the results of the SQL query. I'll amend my original message now.

0 Kudos
Manuel
Dataiker Alumni

Hi,

So it seems that you need an endpoint coordinating the call of other endpoints, as described on this page: https://doc.dataiku.com/dss/latest/apinode/api/endpoints-api.html

Good luck

StephenPegg
Level 2
Author

@Manuel this was exactly what I was looking for and I have managed to successful create a single coordinator endpoint that calls two others.

The first is a SQL query which returns the features required to run a model

The second is a predictive model which takes the input from the first endpoint.

Thanks for the help. I hope this also helps others.