Skip to main content

Add an API key or access token to a request header

Abstract

Learn how to access Sitecore Search APIs by adding an API key or access token in the 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.

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

  • Use the following code sample.

curl -X GET \  

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

  -H 'Authorization: <api-key>'

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

  • Use the following code sample.

curl -X GET \

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

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