Get Keyphrases from a Lexicon Entry - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

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


Get Keyphrases from a Lexicon Entry

Endpoint: GET /v2.0/lexicons/{lexiconId}/entries/{entryId}/keyphrases

Example Requests

cURL

curl --request GET \
  --url https://api-trial.cognigy.ai/new/v2.0/lexicons/{lexiconId}/entries/{entryId}/keyphrases \
  --header 'X-API-Key: <api-key>'

Python

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/lexicons/{lexiconId}/entries/{entryId}/keyphrases"

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

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

print(response.text)

JavaScript

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

fetch('https://api-trial.cognigy.ai/new/v2.0/lexicons/{lexiconId}/entries/{entryId}/keyphrases', 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/lexicons/{lexiconId}/entries/{entryId}/keyphrases",
  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;
}

Response Format

Success (200)

Returns array of Keyphrases of a Lexicon Entry:

[
  {
    "_id": "<string>",
    "mainKeyphrase": "pizza",
    "data": {},
    "keyphrases": {
      "_id": "<string>",
      "value": "pizza",
      "isMainKeyphrase": true
    },
    "slotReferences": [
      "<string>"
    ]
  }
]

Error Responses


Authorizations

API Key


Headers

Accept


Path Parameters


Query Parameters