Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Did you initialize JWT auth flow using /login/jwt-session end point?
When you have generated your JWT token you have to:
Everything is explained here.
Hi @BogdanF , you have to authenticate using the correct user for leveraging section access rules for that particolar user. If you use a specific user, then section access will be applied and you will have answers with data filtered by section access.
Hello Alex. Thank you for your response.
According to the documentation, I use Api-key for authenticate "Authorization: Bearer <API-key>".
How can I authenticate a user? Can I use JWT? Do you have an example?
If you will use API-Key, you cannot authenticate with your users and section access will not be applied.
You have to authenticate using OAuth with impersonation, or JWT. Here some info.
I know JWT. I use it to authenticate users in the Qlik Cloud.
But are you sure I can use it in "Natural Language API" (https://qlik.dev/apis/rest/questions/)?
"Authorization: Bearer <JWT-Token>"?
Here I found it:
"
The Natural Language API does not check section access controls in the app's load script. If an audit administrator has the Developer role and can open apps (as provided through the space permissions), they can view the app usage metrics.
"?
Yes, you should be able to use it. Try to generate a JWT token and then attach it to the header of your REST API call. You should be able to authenticate.
It looks like it's not working.
I'm testing using curl.
When I used this: curl https://MyTenant.eu.qlikcloud.com/api/v1/questions/actions/ask -X POST -H "Authorization: Bearer <API-KEY>"....
I received the correct JSON response.
But when I used this: curl https://MyTenant.eu.qlikcloud.com/api/v1/questions/actions/ask -X POST -H "Authorization: Bearer <JWT-Token>"....
I received:
"
<html>
<head><title>401 Authorization Required</title></head>
<body>
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx</center>
</body>
</html>
"
The JWT token is probably correct because it works outside the API.
What else can I check? Is there an example of using JWT with the Qlik API somewhere?
Hello Alex. Do you have any advice?
Have you try this?
ChatGPT in Qlik Sense
This is not an Qlik Natural Language API.
I want to use Natural Language API.