Search API Code Example

This sample code snippet shows a POST request that creates a question in the knowledge base repository. The request returns a set of search results for the specified question.

Example of Request Body:
$okcsModel = new \RightNow\Models\Okcs(); 
$url = \RightNow\Utils\Config::getConfig(OKCS_SRCH_API_URL) . 'latest/search/question?question=search_keyword'; 
$methodName = 'POST'; 
$postData = '{resultLocales": "en_us", "session": null, "transactionId": 0}'; 
$apiResponse = $okcsModel->makeApiRequest($url, $methodName, $postData);
var_dump($apiResponse);