Get an Example Sentence - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.


Get an Example Sentence

API Request:
GET /v2.0/flows/{flowId}/intents/{intentId}/sentences/{sentenceId}


Example cURL Request

curl --request GET \ 
  --url https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId}/sentences/{sentenceId} \ 
  --header 'X-API-Key: <api-key>'

Example Python Code

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId}/sentences/{sentenceId}"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)

Example JavaScript Fetch API Code

const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://api-trial.cognigy.ai/new/v2.0/flows/{flowId}/intents/{intentId}/sentences/{sentenceId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

HTTP Response Codes

Example Response

{
  "localeReference": "<string>",
  "feedbackReport": {
    "findings": [{}],
    "info": {
      "trueIntent": "<string>",
      "topIntent": "<string>",
      "runnerUp": "<string>",
      "topScore": 123,
      "runnerUpScore": 123,
      "difference": 123,
      "trueIntentName": "<string>",
      "topIntentName": "<string>",
      "runnerUpIntentName": "<string>"
    }
  },
  "text": "I want to buy a pizza.",
  "slots": [
    {
      "type": "anySlot",
      "name": "<string>",
      "start": 123,
      "end": 123
    }
  ],
  "_id": "<string>",
  "createdAt": 1694518620,
  "lastChanged": 1694518620,
  "createdBy": "<string>",
  "lastChangedBy": "<string>"
}

Authorizations

APIKey

Header: X-API-Key
Type: string
Required: Yes

Supply the API Key in the HTTP-Header.

Headers

Path Parameters