How to enable Sitecore ContentHub Preview API

7/5/2021

Problem : HTTP 401 error while accessing /api/graphql/preview/ide or /api/graphql/preview/v1

 

By default, GraphQL endpoint is disabled in Sitecore Content hub.

We need to enable the publishing before using GraphQL endpoint.

  • Open /admin/settingmanagement
  • Search for publishingSettings
  • Enable the publishing
  • Publish Schema

enter image description here

IDE: https://my.stylelabs.io/api/graphql/preview/ide/

Make sure you are passing in "X-GQL-Token" in the headers.

enter image description here

This can be created from

  • admin/api-keys
  • On the specific content collection itself

enter image description here

enter image description here

enter image description here