Get Insight By Id

require 'vendor/autoload.php';


use \Ceic\Api\Configuration; use \Ceic\Api\Apis\InsightsApi; use \Ceic\Api\Models\QueryEntities\InsightsApiQueryEntity;

$accessToken = "ENTER YOUR API KEY HERE"; $exampleInsightId = "INSIGHT_ID";
$config = Configuration::getDefaultConfiguration() Configuration::setDefaultConfiguration($config);
$insightsApi = new InsightsApi(); $insightsQueryEntity = new InsightsApiQueryEntity(); $insightsQueryEntity->setId($exampleInsightId); $insightsQueryEntity->setToken($accessToken);
$insightResult = $insightsApi->getInsightQuery($insightsQueryEntity);
// Access insight result data $insight = $insightResult->getData()[0]; $insightCategory = $insight->getCategory();