Best Practices from Oracle Development's A‑Team

Render CEC Content Item with Images in Oracle Intelligent Bots

Derek Kam
Consulting Solutions Architect

In one of the blog published by Dolf regarding Using CEC with Oracle Intelligent Bots, he demonstrated on how to use Oracle Intelligent Bots to retrieve the content items in CEC (Content and Experience Cloud Service) using the REST API. In this blog, I will extend this use case and provide a simple example of how to render the images and enable multilingual support in Oracle Intelligent Bots. For example, if you have some promotions or blogs stored in CEC as content items, instead of browsing a list of promotions, you can ask the bot to show you the “latest promotions” or search for a blog using the blog title.

The concepts, scripts, and information presented in this article are for educational purposes only. They are not supported by Oracle Development or Support and come with no guarantee or warrant for functionality in any environment other than the test system used to prepare this article. Before applying any changes presented in this article to your environment, you should thoroughly test to assess functionality and performance implications.

This blog also discusses the use of non-public Content SDK/API. The Content SDK/API might change without warning. The Content SDK/API might be published later as part of the Content & Experience Cloud.

In this demo, I will use the Oracle Intelligent Bots with Oracle ACCS (Application Container Cloud). However, you can use the custom components in AMCe (Oracle Autonomous Mobile Cloud Enterprise) to implement the custom code.


We will use the System.CommonResponse components in Oracle Intelligent Bots to display content-rich messages/content from CEC.  With card type in common response component, you can display content item with images/video and provide a link to an external site.  The screenshots below demonstrate the chatbot flow logic and configuration to enable multilingual support and invoke an external component to search CEC using the REST API.


To enable multilingual translation in Oracle Intelligent Bots, you need to select Google Translation Service.


Next, you can move on to develop your custom component. You would need to include the SDK files from Oracle Intelligent Bots for this example, you can obtain SDK files from the sample in this link: http://www.oracle.com/technetwork/topics/cloud/downloads/mobile-suite-3636471.html

Before you invoke the CEC REST API, you need to retrieve the property value stored in Oracle Intelligent Bots by using the SDK.


For this demo, we will use search the content item using the “type” field. So if you enter “Promotion”, it will invoke the CEC Content API using “field:type:equals:Promo” to retrieve all “Promo” content items.


Below is the snippet of the custom NodeJS component to invoke CEC Content REST API to query the content items and item details.  Once we have the items details, we can format the message format required by the Oracle Intelligent Bots SDK.


After you have deployed the custom component to either AMCe or ACCS, you need to configure the service URL in Oracle Intelligent Bots.



Now, you can test your Oracle Intelligent Bots and CEC integration using the custom component deployed in ACCS.



Few tips:

  • Build the output message format in your custom component code.

  • Limit the number of output characters per message. For example:

    • Facebook message text must be UTF-8 and has 2000 characters limit

    • Alexa Voice message must be less than 24576 bytes

  • Some bot clients will display the CEC content item rich text formatted field data with HTML tags, so you would need to store the text in a standard non-rich text format for the item to display properly in bot client.

  • Train and Test your intent confidence.


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha

Recent Content