1

I have set up 2 projects on XM Cloud sandbox environment.

enter image description here

Generating GraphQL EdgeToken from PS (.\New-EdgeToken.ps1 -EnvironmentId <environmentId>) for Project's (xmcloud-edge-integration) environment(dev).

But always GraphQL API returns a response from another project's (xmcloud-edge-2401) environment(xmcloud-edge-2401-devenv).

Any idea what I am doing wrong here, please suggest.

1 Answer 1

0

It is a bit unclear, how you are doing the graphql query. Have you specified the Endpoint, The possible endpoints based on the URL of the cm instance are:

https://xmcloud-edge-integration.sitecorecloud.io/sitecore/api/graph/edge

https://xmcloud-edge-2401.sitecorecloud.io/sitecore/api/graph/edge

And you need to use the correct API key.

Or if you want to use Experience Edge:

https://edge.sitecorecloud.io/api/graphql/v1

Please keep in mind, that the edge endpoint is the same for all customers/projects, the edge identifies the endpoint by the "sc_apikey" header which contains the Edge Token.

If you are using for example nextjs, you need to specify the correct endpoint and API key for these variables (docker):

JSS_EDITING_SECRET=
SITECORE_API_KEY=sitecore API key
SITECORE_API_HOST=https://xmcloud-edge-2401.sitecorecloud.io
GRAPH_QL_ENDPOINT= https://xmcloud-edge-2401.sitecorecloud.io/sitecore/api/graph/edge

If this answer didn't help, please provide a bit more detail about the way your are running the query. you can always test your query using a GUI:

https://[your instance].sitecorecloud.io/sitecore/api/graph/edge/ide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.