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
- 200: Success
- 400: Bad Request
- 401: Unauthorized
- 402: Payment Required
- 403: Forbidden
- 404: Not Found
- 500: Internal Server Error
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
- Accept
Type: enum
Specifies the media type that the client expects in the response. Available options:application/json,application/hal+json,application/xml,text/xml,text/csv. The default value isapplication/json.
Path Parameters
- flowId: string (required) - The unique identifier for the Flow. Required string length:
24. Pattern:^[a-z0-9]{24}$. - intentId: string (required) - The unique identifier for the Intent. Required string length:
24. Pattern:^[a-z0-9]{24}$. - sentenceId: string (required) - The unique identifier for the Example Sentence. Required string length:
24. Pattern:^[a-z0-9]{24}$.