Survey banner
Share your feedback on the Dataiku documentation with this 5 min survey. Thanks! TAKE THE SURVEY

Got the error "API Key not provided" when call to python API endpoint

Solved!
manhnam91
Level 2
Got the error "API Key not provided" when call to python API endpoint

I have created a python function API endpoint in API designer, when I run the test query, it works well.

After that, I created an API key for this API service, but when I call the public API endpoint via Postman (i found the guide here: https://doc.dataiku.com/dss/latest/apinode/first-service-apideployer.html) :

URL: mydomain.com/public/api/v1/<api service id>/<endpoint>/run

Header:

Content-Type: application/json; charset=utf-8

Authorization: Basic <my api key>

I got the response:

{
"errorType": "com.dataiku.dip.exceptions.NotAuthenticatedException",
"message": "API Key not provided (Basic xxxxxxxxxxxxxxxxxxxxxxx)",
"detailedMessage": "API Key not provided (Basic xxxxxxxxxxxxxxxxxxxxxxx)",
"detailedMessageHTML": "<span><span class=\"err-msg\">API Key not provided (Basic xxxxxxxxxxxxxxxxxxxxxxx)</span></span>",
"stackTrace": []
}

Even when i checked to "Allow public access to this service (no authentication)", i got the same error.

Anyone know the cause of this error, please help, many thanks.


Operating system used: Ubuntu 20.04

0 Kudos
1 Solution
manhnam91
Level 2
Author

ah I found the cause, I need to create basic auth by an empty user and the password is the API key first,  and I also need to restart the API service after changing the security config

View solution in original post

2 Replies
manhnam91
Level 2
Author

ah I found the cause, I need to create basic auth by an empty user and the password is the API key first,  and I also need to restart the API service after changing the security config

CoreyS
Dataiker Alumni

Thank you for sharing your solution with the Community @manhnam91

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