About the REST Endpoint Configuration Files

When loading a search page in a web browser, the Coveo JavaScript Search Framework components use the REST Endpoint Proxy to perform queries. As it’s installed on the Sitecore website, the REST Endpoint Proxy can access information from the Sitecore context.

The REST Endpoint Proxy relies on two important modules. The first one is a custom HTTP handler that’s seen as the REST endpoint itself. Its default location in the website is https://<INSTANCE_HOSTNAME>/coveo/rest. The second module is the Search API, which resides in the Coveo Platform. The Search API is responsible for querying the search index.

This article presents the REST endpoint configuration settings stored in the Coveo.SearchProvider.Rest.config and the Coveo.SearchProvider.Rest.Custom.config patch file. These settings may be found under the configuration/sitecore/coveo/restEndpointConfiguration element.

The Coveo.SearchProvider.Rest.config file also contains a section for pipeline configurations (see About the REST Endpoint Pipelines).

The restEndpointConfiguration Section Settings

Many of the following settings are automatically set at activation in the Coveo.SearchProvider.Rest.Custom.config patch file, while the others have default values that shouldn’t need to be changed.

Name Description Default value
searchApiUri The URI to connect to the Coveo Search API (see Validate Routes and Ports). You shouldn't have to update the value of this setting.
analyticsUri The URI to connect to the Coveo Usage Analytics API (see Validate Routes and Ports). You shouldn't have to update the value of this setting.
organizationId The ID of the Coveo organization that’s being queried. You shouldn't have to update the value of this setting.
apiKey The encrypted API key of the Coveo organization that’s being queried. You shouldn't have to update the value of this setting.
Coveo for Sitecore (October 30, 2020)
bypassCoveoForSitecoreProxy
Whether to bypass the Coveo for Sitecore proxy for search and analytics calls (see Performing a Query from a Coveo-Powered Search Page Through the Proxy and Performing a Query from a Coveo-Powered Search Page Directly to the Coveo Platform). You should only change the value of this setting in the Command Center, in the Configuration Manager section. false
requestTimeout The timeout period for requests going through the search API proxy. 00:00:30
searchTokenExpiration Defines the period when the search token is valid. 01:00:00
restEndpointPath Defines the location of the REST endpoint in the Sitecore website (see Performing a Query from a Coveo-Powered Search Page Through the Proxy). You shouldn't have to update the value of this setting. /coveo/rest

Compiled Configuration Example

When examining the compiled configuration, the content of several nodes will be a reference to the value of a corresponding <cloudPlatformConfiguration> element, because of settings in Coveo.SearchProvider.Rest.Custom.config overriding the ones in Coveo.SearchProvider.Rest.config.

<restEndpointConfiguration>
  ...
  <searchApiUri ref="coveo/cloudPlatformConfiguration/cloudPlatformUri"/>
  <analyticsUri>https://platform.cloud.coveo.com/rest/ua</analyticsUri>
  <apiKey ref="coveo/cloudPlatformConfiguration/searchApiKey" patch:source="Coveo.SearchProvider.Rest.Custom.config"/>
  <organizationId ref="coveo/cloudPlatformConfiguration/organizationId" patch:source="Coveo.SearchProvider.Rest.Custom.config"/>
</restEndpointConfiguration>

In pre-September 2020 releases of Coveo for Sitecore, the <analyticsUri> element text node is https://usageanalytics.coveo.com.

Recommended Articles