Two new samples of using the Watson Content Hub (WCH) APIs are now available for download on GitHub.

sample-article-create

This sample shows how you can easily build a custom web application for creating new content items, including image assets in Watson Content Hub. It provides a form for creating a new “Article” and you can upload an image for the article.

This sample is built in JavaScript and HTML, and it illustrates

  • Authenticating to the Watson Content Hub and calling APIs that require authentication.
  • Using the authoring services for resources, assets, and content to upload a resource, create an asset, and create an “Article” content item that includes the image.

This screenshot shows the completed form for a new Article:
create-article-screenshot-small

View and download the sample on GitHub here: https://github.com/ibm-wch/sample-article-create

sample-search-api

This sample can be used to explore the search API capabilities of Watson Content Hub. This sample is a technical sample that is intended for developers who are exploring the WCH APIs and data model.

The search functionality in WCH is built with the powerful SOLR engine, and it provides a rich set of features that are controlled easily by using parameters. This sample gives a set of example search queries that you can try. You can view and edit the parameters to help you learn how to use the search API in your own applications. It shows a table of search results, and you can click any row to see a pop-up window with the JSON for that result entry.

This sample illustrates:

  • Using the search API and some of the powerful filtering capabilities.
  • Calling the authenticated search API both from client JavaScript and from Node.js.
  • Using the document data that is optionally returned as part of the search results.
  • How to build a simple Node.js Express server that calls search as a “proxied” request. This way of accessing WCH doesn’t require the CORS enablement that is required for browser JavaScript calls to WCH.

View and download the sample on GitHub here: https://github.com/ibm-wch/sample-search-api

Join The Discussion

Your email address will not be published. Required fields are marked *