Submit your inspiring success story or innovative use case to the 2022 Dataiku Frontrunner Awards! ENTER YOUR SUBMISSION

api

2017-sky
Level 1
api

I wrote an example in Python. How do I set this function and request this function through HTTP

0 Kudos
8 Replies
CoreyS
Community Manager
Community Manager

Hi,  @2017-sky , thank you for posting! Can you provide any further details  or visual examples on this thread to assist users in helping you find a solution (insert examples like Dataiku version etc.) Also, can you let us know if you’ve tried any fixes already? This should lead to a quicker response from the community.

Looking for more resources to help you use Dataiku effectively and upskill your knowledge? Check out these great resources: Dataiku Academy | Documentation | Knowledge Base

A reply answered your question? Mark as ‘Accepted Solution’ to help others like you!
0 Kudos
AlexT
Dataiker
Dataiker

Hi,

If understand your ask, you would want to create a Python function API endpoint.

Please see: 

https://doc.dataiku.com/dss/latest/apinode/endpoint-python-function.html

If you have any issues error please share details and your code to further assist.

 

Thanks

0 Kudos
2017-sky
Level 1
Author

Now I just want to write an API and call it externally in the form of HTTP. Is there a demo for our reference? I see that the tutorial given is not very detailed. I tried a lot, but I failed. I hope someone can help me

0 Kudos
AlexT
Dataiker
Dataiker

Hi,

Can you share what you have done so far and what exact errors you are getting?  What do you want your API endpoint to do return?  

There are 2 detailed endpoints types covered here :

https://knowledge.dataiku.com/latest/courses/mlops/real-time-apis/create-endpoints-hands-on.html?hig...

I've also attached a short video with the python function endpoint.  

To call the endpoint you can refer to the docs here :

https://doc.dataiku.com/dss/api/9.0/apinode-user/#custom-function-endpoints

0 Kudos
2017-sky
Level 1
Author

Hello, maybe what I said is still unclear. My idea is similar to front-end and back-end development. I write interfaces. My front-end page realizes the whole function by calling the interfaces written by my back-end. Now I want to write algorithms on dataiku and call my algorithms on ocean. I watched the video you gave me. How can I pass it http://dss_host:dss_port/public/api/ , this is to call my algorithm. If you can, can you send some video teaching

0 Kudos
AlexT
Dataiker
Dataiker

If you want to call the endpoint once you Deploy it to API Node you make the GET requests 

API_NODE/public/api/v1/{serviceId}/{endpointId}/run/{?param1}{?param2}

Please note to deploy API nodes you will need specific license ( Enterprise some Online plans etc.) 

 

0 Kudos
2017-sky
Level 1
Author

97c19a83bcbbcc343e2f44f6dcc2eac.png

 I tried again after learning the video last time and found that the request was still unsuccessful. Please attach my question

0 Kudos
2017-sky
Level 1
Author

 Oops: an unexpected error occurred

Expected a com.google.gson.JsonArray but was com.google.gson.JsonPrimitive

Please see our options for getting help

HTTP code: 500, type: com.google.gson.JsonSyntaxException

 

 

This problem also needs your help, thank you

0 Kudos