Understanding the REST Endpoint Configuration Files

When loading a search page in a web browser, the JavaScript Search Framework components use the Coveo Search REST endpoint to perform queries. This REST endpoint is installed on the Sitecore website. This way, it can better leverage the information present in the Sitecore context.

To make this communication work, the Coveo Search REST endpoint relies on two very important components. The first one is a custom HTTP handler that’s seen as the REST endpoint itself. Its default location in the website is /coveo/rest. The second component is the Search API service, which is usually installed along with the Coveo Enterprise Search (CES) instance for On-Premises installations, and available in Coveo Cloud for Cloud installations. The Search API service is responsible for querying the search index.

Understanding the Coveo Search Provider’s Configuration File (Coveo.SearchProvider.Rest.config)

Those are the basic settings that must be configured initially. They can be found under the configuration/sitecore/coveo/restEndpointConfiguration element.

Name Description Example value
Cloud only


The API key of the Cloud organization that's being queried.

When you log in to a Coveo organization using the Configuration Wizard, an API key is stored in its encrypted form in the configuration file.

On-Premises only


The secret key that's configured in the Search API service. This key is required so that the search API can trust the Sitecore application. replace this with your own application secret
Cloud only


The ID of the Cloud organization that's being queried.
requestTimeout The timeout period for requests going through the search API proxy. 00:00:30
restEndpointPath Defines the location of the REST endpoint in the Sitecore website. /coveo/rest
searchTokenExpiration Defines the period when the search token is valid. 01:00:00
searchApiUri The URI to connect to the Search API service, or to the Cloud REST endpoint. http://localhost:8080

Example of a Cloud Configuration

By default, since everything is already defined in the configuration of the cloud platform, the content of every node will be a reference to the cloud platform configuration node corresponding to the required value.

  <searchApiUri ref="coveo/cloudPlatformConfiguration/cloudPlatformUri" />
  <apiKey ref="coveo/cloudPlatformConfiguration/apiKey" />
  <organizationId ref="coveo/cloudPlatformConfiguration/organizationId" />