Natural Language

Ask natural languages questions and context aware partial questions against applications enabled for conversational analytics or a specific app to receive Insight Advisor generated responses and suggestions

Endpoints

Skip to section
POST/v1/questions/actions/ask

Returns the generated response for parsed chat queries, if no app was specified nor present in conversation context, suggests matching apps.

embed

Header Parameters POST /v1/questions/actions/ask

qlik-web-integration-id
optional
string

This header is only required for external clients or mashups for QCS, this value of this property should be the id of the web integration set up for the external client/mashup

Request Body POST /v1/questions/actions/ask

application/json

No description

Responses POST /v1/questions/actions/ask

200
optional, application/json

The sentence is not created as an app was not specified, but matching apps are suggested

201
optional, application/json

The sentence created

400
optional, application/json

Bad request. The payload is not formed correctly.

401
optional, application/json

User is not authorized

422
optional, application/json

Unprocessable entity. The payload contains fields that are invalid, such as too long of a query.

default
optional, application/json

Unexpected error.

POST/v1/questions/actions/ask

curl "https://your-tenant.us.qlikcloud.com/api/v1/questions/actions/ask" \
 -X POST \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/json" \
 -d '{"app":{"id":"string","name":"string"},"lang":"string","text":"string","disableFollowups":true,"disableNarrative":true,"recommendationId":"string","clearEntityContext":true,"visualizationTypes":[],"enableVisualizations":true,"disableConversationContext":true}'

Request POST /v1/questions/actions/ask

{
  "app": {
    "id": "string",
    "name": "string"
  },
  "lang": "string",
  "text": "string",
  "disableFollowups": true,
  "disableNarrative": true,
  "recommendationId": "string",
  "clearEntityContext": true,
  "visualizationTypes": [],
  "enableVisualizations": true,
  "disableConversationContext": true
}

Response POST /v1/questions/actions/ask

{
  "apps": [
    {
      "id": "string",
      "name": "string"
    }
  ],
  "nluInfo": {
    "elements": [
      {
        "text": "string",
        "type": "string",
        "entity": true,
        "isFilter": true,
        "typeName": "string",
        "errorText": "string",
        "filterText": "string",
        "typeTranslated": "string",
        "filterFieldName": "string"
      }
    ]
  },
  "conversationalResponse": [
    {
      "apps": [
        {
          "id": "string",
          "name": "string"
        }
      ],
      "responses": [
        {
          "type": "string",
          "imageUrl": "string",
          "infoType": "string",
          "sentence": {
            "text": "string"
          },
          "narrative": {
            "text": "string"
          },
          "infoValues": [],
          "followupSentence": "string",
          "renderVisualization": {
            "data": {},
            "language": "string"
          }
        }
      ],
      "contextInfo": "string",
      "drillDownURI": "string",
      "sentenceWithMatches": "string"
    }
  ]
}

ConversationalResponsePart

Properties

type
optional
string

No description

imageUrl
optional
string

No description

infoType
optional
string

No description

sentence
optional

No description

narrative

No description

infoValues
optional
Array<>

No description

followupSentence
optional
string

No description

renderVisualization

No description

Error

object

An error object.

Properties

code
string

The error code.

meta
optional
object

Additional properties relating to the error.

title
string

Summary of the problem.

detail
optional
string

A human-readable explanation specific to this occurrence of the problem.

source
optional

References to the source of the error.

Errors

object

Properties

errors
optional

No description

NarrativeResponse

Properties

text
optional
string

No description

NluInfo

Properties

elements
optional

No description

NluInfoElements

Properties

text
optional
string

No description

type
optional
string

No description

entity
optional
boolean

No description

isFilter
optional
boolean

No description

typeName
optional
string

No description

errorText
optional
string

No description

filterText
optional
string

No description

typeTranslated
optional
string

No description

filterFieldName
optional
string

No description

QlikApp

Properties

id
optional
string

No description

name
optional
string

No description

QueryCreate

object

Properties

app
optional

No description

lang
optional
string

The language to assume when parsing, specified as an ISO-639-1 code. Defaults to 'en' (English).

text
string

The sentence that will be parsed.

disableFollowups
optional, default=false
boolean

The flag specifies whether to disable follow-up recommendations.

disableNarrative
optional, default=false
boolean

Flag that specifies whether the narratives should be generated for the user query or not.

recommendationId
optional
string

property that contains the Id of the recommendation for which the response should be generated.

clearEntityContext
optional, default=false
boolean

Flag that clears the entity context.

visualizationTypes
optional
Array<string>

Specify visualizationTypes for only which visualization object should be provided if enableVisualizations is set to true. For eg. ['linechart', 'barchart']

enableVisualizations
optional, default=false
boolean

Flag that specifies whether visualization object should be provided or not.

disableConversationContext
optional, default=false
boolean

Flag that specifies either to enable converastion context.

QueryCreated

object

The attributes of sentences.

Properties

apps
optional

No description

nluInfo
optional

No description

conversationalResponse
optional

A list of conversational responses.

QueryNotCreated

object

Properties

apps
optional

No description

nluInfo
optional

No description

conversationalResponse

No description

QueryResponse

object

Properties

apps
optional

No description

responses

No description

contextInfo
optional
string

For contextual responses, this string contains a list of entities that are used to produce the response.

drillDownURI
optional
string

The URL with the query injected to insight advisor of the app to which the query belongs.

sentenceWithMatches
optional
string

No description

RenderVisualization

Properties

data
optional
object

Data object should be used to render visualization

language
optional
string

No description

v0.448.13
Was this page helpful?