Hands on with Sitecore Experience Edge for Content Hub
One of the exciting news in the Sitecore world recently was the release of Sitecore Experience Edge for Content Hub (Experience Edge for XM is coming later this year, so will focus on Content Hub for now). If you haven't heard the news yet, I strongly recommend watching this Youtube video to see it in real action. And here is the official Experience Edge™ for Content Hub documentation for a more thorough understanding.
To get a hands-on demo experience with Sitecore Experience Edge for Content Hub, please talk to your Sitecore contacts for accessing the Content Hub Sandbox portal. The information below also applies to the Production setup, just ignore the parts related to sandboxes.
- You should receive the instructions and accesses to create a sandbox Content Hub environment, just ensure the following when creating the sandbox
- Select version 4.0.0
- Select "Content Publishing" license
- When CH sandbox is up and running, head to Settings->PublishingSettings and ensure "Publishing enabled" is ticked and Save.
- Ensure that there are Content Collections and Content that are in the Final state (This is for viewing them in Delivery API)
- Ensure that the Content Collections and Content have the green tick cloud icon that says "Published to delivery platform"
- You can generate API tokens from Settings->API Keys or from the Content Collections
- The URL to GraphQL IDE is https://[[Your demo instance hostname]]/api/graphql/preview/ide/
- Preview API endpoint for demo container is https://[[Your demo instance hostname]]/api/graphql/preview/v1
You can use Postman to test Delivery and Preview APIs too. Below is an export of a Postman collection:
{
"info": {
"_postman_id": "66f4925b-b6f0-4ed1-bea3-bdb09ba57045",
"name": "Experience Edge For CH",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Preview API",
"request": {
"method": "POST",
"header": [
{
"key": "X-GQL-Token",
"value": "",
"type": "text"
}
],
"body": {
"mode": "graphql",
"graphql": {
"query": "{\r\n allM_ContentCollection {\r\n results {\r\n contentCollectionName\r\n id\r\n publishStatus\r\n contentCollectionToContent{\r\n results{\r\n content_Name\r\n content_PublicationDate\r\n publishStatus\r\n }\r\n }\r\n }\r\n }\r\n}",
"variables": ""
},
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https:///api/graphql/preview/v1",
"protocol": "https",
"host": [
""
],
"path": [
"api",
"graphql",
"preview",
"v1"
]
}
},
"response": []
},
{
"name": "Delivery API - Beta",
"request": {
"method": "POST",
"header": [
{
"key": "X-GQL-Token",
"value": "",
"type": "text"
}
],
"body": {
"mode": "graphql",
"graphql": {
"query": "{\r\n allM_ContentCollection {\r\n results {\r\n contentCollectionName\r\n id\r\n publishStatus\r\n contentCollectionToContent{\r\n results{\r\n content_Name\r\n content_PublicationDate\r\n publishStatus\r\n }\r\n }\r\n }\r\n }\r\n}",
"variables": ""
},
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://edge-beta.sitecorecloud.io/api/graphql/v1",
"protocol": "https",
"host": [
"edge-beta",
"sitecorecloud",
"io"
],
"path": [
"api",
"graphql",
"v1"
]
}
},
"response": []
}
]
}
3 variables are:
- hostname
- PreviewToken
- DeliveryToken
Have fun!