Skill Level: Beginner
You can now use the Watson Content Hub Palette in delivery mode. By using the Palette in delivery mode, you can now select content and assets without authentication. The palette in the delivery mode returns only the published assets and content. This tutorial shows you how to launch the Watson Content Hub Palette in delivery mode in your application.
You must have a Watson Content Hub tenant from which you want to select Content or Assets. If you do not already have a Watson Content Hub tenant, you can sign up for free here: https://www.ibm.com/uk-en/marketplace/cloud-cms-solution
Determine the API URL of your tenant
The client must specify the API URL when the Palette is launched. The tenant API URL is added as the apiUrl query parameter. For example:
Obtain the API URL from the ‘Hub information’ dialog in the WCH UI:
- The Delivery Palette is only accessible through the Authoring host https://www.digitalexperience.ibm.com/content-picker/picker.html .
- Therefore, API requests are issued from the ‘www’ Authoring host, but are made to the ‘myN’ Delivery host. Requests to the ‘myN’ Delivery host from other domains are blocked by default and you encounter a CORS exception. CORS, or Cross-Origin Resource Sharing is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.
- Therefore, it is necessary to add the ‘www’ Authoring host as a trusted domain for your tenant:
Access the Delivery Palette
Now that you know your API URL and enabled CORS for your tenant you can access the WCH Palette in delivery mode at the URL determined in step one:
You can add further query parameters to launch the Palette in other modes too. For example:
1. Launch the Delivery Palette for Content Items only:
2. Launch the Delivery Palette for Assets only:
3. Launch the Delivery Palette for Image Assets only:
4. Launch the Delivery Palette for Image Assets tagged with ‘nature’ only:
Accessing the WCH Palette sample page for your tenant
You can access the Delivery Palette through the Sample page: https://www.digitalexperience.ibm.com/content-picker/samples/pickerConsumer.html
Note: The sample page also includes Authoring launch modes that require you to be logged in to WCH and have the WCH cookies – the delivery options are unauthenticated.
You can now access all of the Content and Assets from your Watson Content Hub tenant using the Watson Content Hub Palette.