Get Yes/No Intents - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

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

API Request

GET
/v2.0/locales/{localeId}/yesnointents

Request Example

cURL

curl --request GET \
  --url https://api-trial.cognigy.ai/new/v2.0/locales/{localeId}/yesnointents \
  --header 'X-API-Key: <api-key>'

Python

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/locales/{localeId}/yesnointents"

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

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

print(response.text)

JavaScript (Fetch)

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

fetch('https://api-trial.cognigy.ai/new/v2.0/locales/{localeId}/yesnointents', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

PHP

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-trial.cognigy.ai/new/v2.0/locales/{localeId}/yesnointents",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "X-API-Key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Responses

Status Description
200 Successful response, returns the yesIntent, noIntent, and rejectIntent objects for the given locale
400 Bad Request Error, validation failed. Missing payload.
401 Unauthorized Error, invalid API key.
402 Payment Required Error, payment required to access this resource.
403 Forbidden Error, access is denied.
404 Not Found Error, resource not found.
500 Internal Server Error.

Sample Response Structure

For a successful response:

{
  "yesIntent": {
    "isDisabled": true,
    "name": "pizza",
    "_id": "<string>",
    "rules": [
      "<string>"
    ]
  },
  "noIntent": {
    "isDisabled": true,
    "name": "pizza",
    "_id": "<string>",
    "rules": [
      "<string>"
    ]
  },
  "rejectIntent": {
    "isDisabled": true,
    "name": "pizza",
    "_id": "<string>",
    "rules": [
      "<string>"
    ]
  }
}

Path Parameters

Authorizations