Generate an Edge token

To query the content published on Experience Edge, you need to generate an Edge token and include it in every call to the Delivery API.

Note

The Delivery API is a GraphQL API that provides access to your approved and published content, optimized for performance and high availability. Use this API for all production-related actions. You can set up the delivery API playground to test your published content. For reference, you can use the Query examples.

You can generate an Edge token using one of the following methods.

Generate an Edge token using the XM Cloud Deploy app

If you have access to the Deploy app, you can generate an Edge token from the environment details page.

To generate an Edge token using the XM Cloud Deploy app:

  1. On the navigation pane of the XM Cloud Deploy app, click Projects.

  2. On the Projects page, click the project that contains the environment where you want to generate an Edge token.

  3. On the project page, click the environment you want.

  4. On the environment page, click the Details tab.

  5. On the Details tab, click Generate Delivery API token.

Generate an Edge token using the XM Cloud Deploy REST API

If you have access to the Deploy app, you can generate a token by generating an access token for the CM instance, then calling the XM Cloud Deploy API.

To generate an Edge token using the XM Cloud Deploy REST API:

  1. Create an organization automation client or an automation client for your environment.

  2. Use the client ID and client secret to request a JWT. The access_token value is your access token.

  3. In the XM Cloud Deploy app, on the environment details page of the environment where you want to create an Edge API token, get the ID.

  4. Run the following curl command:

    RequestResponse
    curl --location "https://xmclouddeploy-api.sitecorecloud.io/api/environments/v1/<your_environment_id>/obtain-edge-token" --header "Accept: text/plain" --header "Authorization: Bearer <your_access_token>"

    The apiKey is your token.

Generate an Edge token from a site created in the XM Cloud Dashboard

If you have created a site from the XM Cloud Dashboard, You can generate a token from the site settings.

To generate an Edge token using a site created in the XM Cloud Dashboard:

  1. In the Sitecore Cloud Portal or the XM Cloud Deploy app, open the XM Cloud Dashboard of the environment where you want to create an Edge API token.

  2. On the Dashboard, click Sites.

  3. Click the Actions menu of any site, then click Settings.

  4. On the Settings page, on the Developer Settings tab, click Generate API Key.

Generate an Edge token using the Token API

If you have access to the Deploy app, you can also generate an Edge token by first generating an access token for the Token API, then calling the Token API.

To generate an Edge token using the Token API:

  1. Create an Edge administration client for an XM Cloud environment.

  2. Use the client ID and client secret to request a JWT for Experience Edge. The access_token value is your access token.

  3. Using the access token for authorization, use the Create endpoint of the Token API to generate an Edge token.

Do you have some feedback for us?

If you have suggestions for improving this article,