Tailwind Logo

Retrieve content from Experience Edge using Postman

XM Cloud

Published: 2023-12-15

Sitecore XM Cloud offers Sitecore Experience Edge as a content delivery mechanism. We will use Postman to see how the data can actually be retrieved.

Check before making a connection

We will use the values we can get from XM Cloud Deploy to work with Experience Edge using Postman. First, check the bottom of the Detail page of the screen where you can see the instance information.

postmanedge01.png

In this case, we will refer to the Live GraphQL IDE (Experience Edge). From the above screen, click on Launch IDE to open a screen that can be accessed in a browser. At this time, in the Headers section, use the following format and enter the ID generated in the administration screen above for the key.

JSON
{
  "sc_apikey": "deliverykey"
}

If you have accessed it correctly, the error disappears in the area displaying the results on the right, as shown below; click on the Schema tab to see the information available in GraphQL.

postmanedge02.png

We have confirmed that we get all the information we need to connect from this screen.

Access using Postman

First, create a new request. This time, since we will use the delivery API, set the URL to https://edge.sitecorecloud.io/api/graphql/v1. For the Headler section, open the Authorization field, and set the type as API key with the same value as the Json data used above as shown below.

postmanedge03.png

If the above values are correct, switching to the GraphQL tab will show the items that can be retrieved as follows

postmanedge04.png

Postman is now ready.

Simple Data Acquisition

We will create a query using the items shown in Postman.

postmanedge05.png

In the query shown on the right, there is a red line and an error is indicated. This is because you must always specify the language. In this case, we will set en.

postmanedge06.png

The error is no longer displayed. If you run the program at this stage, you will see the following results.

postmanedge07.png

The result is displayed, but this time the top data is returned because Path is not specified. Next, specify the Path. This time, set /sitecore/content/sitecoredemo-jp/sitecoredemo-jp/Home as the Home of the site you are creating. The result is as follows.

postmanedge08.png

Home We were able to retrieve data about the item.

Summary

In this case, we reviewed the steps for retrieving data through Experience Edge; by using Postman, we were able to see the data in Json, which we use in our delivery.

Tags