Generate an Edge token

To query the content published on Experience Edge, generate an Edge token and include it in every call to the Delivery API. If your app uses JSS 21.6+, you can also use the Context ID instead of an Edge token.

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 for the Delivery API.

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 tab.

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 Environment details tab > 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 tab 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 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,