Add an API key or access token to a request header

You must include an API key or an access token in the header of every request you send to a Sitecore Search API.

Add an API key to a request header

To pass the API key in the header when you make a POST request to the search and recommendation API

  • Use the following code sample.

RequestResponse
curl -X POST \  

  'https://discover.sitecorecloud.io/discover/v2/<customer-key>?data={"content":{}}' \

  -H 'Authorization: <api-key>'

Add an access token to a request header

To pass the access token in the header when you make a POST request to the search and recommendation API:

  • Use the following code sample.

RequestResponse
curl -X POST \

  'https://discover.sitecorecloud.io/discover/v2/<customer-key>?data={"content":{}}' \

  -H 'Authorization: Bearer <access-token>'

Do you have some feedback for us?

If you have suggestions for improving this article,