# Domain App using Internal Data

## Goal

Our goal is to help users explore the functionality of the iX Hello platform without requiring integrations with any external platform. We will create a Lex App named “Retail Demo”. Retail Demo is an app set aimed for retail customer and retail customer service provider. We will be using a JSON data source and perform data retrieval operations on them.

## Steps

The following shows the general steps/activities that will be carried out in setting up this integration. **Note:** It is advisable to use same email for signup across the 3 channels below. Step 1 -3 below are required.

1. [Sign up for AWS Lex Account ](https://portal.aws.amazon.com/billing/signup#/start)
2. [Sign up IAM credentials with access to AWS Lex](https://signin.aws.amazon.com/oauth?response_type=code\&client_id=arn%3Aaws%3Asignin%3A%3A%3Aconsole%2Fcanvas\&redirect_uri=https%3A%2F%2Fus-east-1.console.aws.amazon.com%2Fconsole%2Fhome%3FhashArgs%3D%2523%26isauthcode%3Dtrue%26region%3Dus-east-1%26state%3DhashArgsFromTB_us-east-1_66a182a09e1939d4\&forceMobileLayout=0\&forceMobileApp=0\&code_challenge=MWLgSfEm1MeFttCT2liFsrW9cjifaVPxa0JcDTOUVcY\&code_challenge_method=SHA-256)
3. [Sign up for iX Hello platform](https://bots.ixhello.com/Account/Login?ReturnUrl=%2F).
4. Ensure you Login with Amazon (LWA) account which is setup by your admin. If you are the account admin, you can follow this instruction to set it up.
5. Create Content Categories, Content using the JSON data sources.
6. Create a custom App in iX Hello.
7. Publish the App.
8. Test the Lex App.

## Prerequisite

* **An active AWS Account**

You should have an active AWS Account. If you do not have it, you can create an AWS account at <https://portal.aws.amazon.com/billing/signup#/start>​ \
\&#xNAN;*AWS Accounts Include 12 Months of Free Tier Access*

* **IAM Credentials with access to AWS Lex**

AWS credentials are required to create a connection with Lex. This is going to be used while creating a Lex bot from the iX Hello platform.

* **A configured Amazon Connect instance** If you want to use agent chat and voice, call in your webchat, you should have a configured and running Amazon connect instance.

  1. If you are new to Amazon Connect, you can start by creating a [Free Tier Amazon Web Services account.](https://aws.amazon.com/free/)​
  2. Create a new instance of Amazon Connect and obtain a phone number using this [official documentation](http://docs.aws.amazon.com/connect/latest/adminguide/gettingstarted.html) from Amazon. Depending upon your location and the location of your target customers, you might need to perform some additional work here. Help from technical department might be required depending upon the scenario.
  3. After creating the instance, [Amazon Connect Home](https://console.aws.amazon.com/connect/) will look like this:

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FW64tPVtpVDCIpxuF3mr6%2Fimage.png?alt=media&#x26;token=d9431fad-ea28-4e6b-90e2-2bb29a11c659" alt=""><figcaption></figcaption></figure>

1. **An iX Hello Account**

You should have an active AWS-Account. If you do not have it, you can create an AWS account at <https://portal.aws.amazon.com/billing/signup#/start>

For steps to create an iX Hello account, follow the steps at <https://docs.ixhello.com/ixhc/general/ixhello-create-account>

## Creating Content Categories and Contents

Contents can be in the form of text, media files (video, audio, image, pdf), Json data that are either uploaded to the iX Hello platform or can be a public URL of the corresponding files. These can be accessed using Internal Data connection facility provided by the platform for using in app building. Content Categories allow the grouping of contents based on their domain similarity. For this tutorial, we will be uploading JSON data files to iX Hello, create Content using them, and later, these contents will be used in app building.

1. To begin, login to the iX Hello URL platform <https://bots.ixhello.com/>

On the left navigation menu do the following:

**Click:** Content

**Select:** Content Categories

1. **Click:** Add New Category

<figure><img src="/files/szarVWbBcg0XiFIlsbTh" alt="" width="563"><figcaption></figcaption></figure>

1. In the resulting popup, choose:

**Enter Content Category:** Retail Domain

**Enter Description:** Content category for retail domain,

**Click:** Save

<figure><img src="/files/M7qlvFcTOTXBBszoAIbi" alt="" width="375"><figcaption></figcaption></figure>

1. Now, let’s create content. **On the side menu do the following:**

**Click:** Content

**Select:** Content

**Click:** Add New Content

<figure><img src="/files/qQLKFhVseLEXxSyqtONO" alt="" width="563"><figcaption></figcaption></figure>

1. The following pop up will appear. Enter details to create a content:

**Content Name:** Retail

**Content Code:** Retail

**Content Category:** Retail Domain

**Text:** Content for Retail Data Source

**Select:** Media

**Media Type:** Select JSON

**Media Source:** Select Upload File

**Media File:** For sample data, you can download [Retail.json](https://demovideo.s3.amazonaws.com/Retail.json). Copy and the data sample in a notepad and save it as a JSON file. Name it as “**Retail.json**”. Click on Choose File and select “Retail.json” file from your system.

Click on Add button. This shall upload Retail.json to the iX Hello platform. Users are required to keep record of **Content Name, Content Code** and **Content Category,** for later use in the app building.

<figure><img src="/files/G85TkwZ4P4mnhWHe6VOo" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/B3YD2sgqQq5i5ZBpKpRo" alt="" width="563"><figcaption></figcaption></figure>

You can also select Media URL as the media source and provide a public URL of the media file.

For more information on creating a content using JSON File, you can refer to [this](https://docs.ixhello.com/ixhc/general/ai-contents/add-ai-content) document.

## Creating Data Source

1. To access the content created in Step 2, we require to create a connection configuration. **On the side menu:**

**Click:** Integration

**Select:** Connect System

**Click:** Add New Connection

<figure><img src="/files/KOhxlZaMJiaWYO7UqXb3" alt="" width="563"><figcaption></figcaption></figure>

1. Enter the following details in the pop-up window:

**Select Integration Category:** Custom

**Select System Type:** Internal Content

**System Instance Name:** Internal Content DS

And click Connect System.

<figure><img src="/files/LhZOjAC9PMNlrRiFwtMH" alt="" width="563"><figcaption></figcaption></figure>

## Create Custom App in iX Hello

1. To create a custom App in iX Hello:

**Click:** Custom Apps in menu.

**Select:** Manage Apps

**Click:** Create New Custom App button

<figure><img src="/files/QrCtlJcRlrJQD7xwMdph" alt="" width="563"><figcaption></figcaption></figure>

1. Then complete the following steps:

**Name:** Retail Demo

**Custom App Type: Search**

**Category:** Retail Domain, same as the content category in Step 3.

**Click:** Save

<figure><img src="/files/HZotwkixhn42pGvzjsRX" alt="" width="375"><figcaption></figcaption></figure>

1. In the top menu select “**Data Sources**” tab, then “**Create New Data Source**”.

Enter the following in the fields:

**Name:** Retail DS

**Integration Configuration:** Internal Content: Internal Content DS.

**Click:** Save

<figure><img src="/files/B9luWq3iAXFbhf9fYtmY" alt="" width="375"><figcaption></figcaption></figure>

1. In the top menu select “**Methods”** tab, then “**Create New Methods**”.

Enter the following in the fields:

**Name**: GetProductInfoMethod

**Request Type**: GetJSONContents

&#x20;**ContentID**: Retail. ContentID shall match the name of the content uploaded in Step 12.

**Result Type**: ListofRecords

**Record JsonPath**: $.productCatalog\[?(@.productName=="{{ProductName}}")]

**Empty Result Template:** I'm sorry, I could not find your product.

**Result Template:** Here is what i found for {{Input.ProductName}} :{{Records}}

**Record Template:** Price : {{price}}, restock amount: {{restockAmount}}, discount : {{discount}} and tax: {{tax}},

<figure><img src="/files/AeStU8l3ETdd2pj0e29C" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/hpJmtYRwZTRlex1arJEn" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/QFPNX44EqzAUJPL21GnH" alt="" width="563"><figcaption></figcaption></figure>

1. After the method has been created, let us test it.

<figure><img src="/files/AiHawn51zUg4ZTvuzkGc" alt=""><figcaption></figcaption></figure>

1. If you observe the following result in your Test Result tab, your method build is successful. You can now proceed to the next step. Otherwise, you might want to re-check your previous steps first. Since method defines the functionality of the App, this is a very crucial step.

<img src="/files/-MlOfL6I9Fu1hnYoGRTs" alt="" width="563">

1. In the top menu select “**Intent”** tab and “**Create New Intent**”.

<figure><img src="/files/L27TmVVGSgrCLZU6Sx8X" alt="" width="563"><figcaption></figcaption></figure>

1. &#x20;Make sure to select the same method you created on Step 16.

**Name:** GetProductInfoInput

**Intent Type:** Search

**Intent Action:** Execute Method

**Data Source:** Retail DS

**Data Source Method:** GetProductInfoInput

**Click:** Save

<figure><img src="/files/z6abHzPHxFwFSYaUETU7" alt="" width="365"><figcaption></figcaption></figure>

1. In the top menu select “**Slots**” tab, select “**Create New Slot**”.

<figure><img src="/files/hBZCdir0urAzBvevuP3p" alt="" width="563"><figcaption></figcaption></figure>

1. Note the Reprompt message is what Lex will ask if it can’t fill/resolve the person slot.

**Name:** ProductName

**Slot Order:** 1

**Reprompt Message:** what’s the product name

**Type:** Text

**App:** Retail Demo

**Intent:** GetProductInfoInput

**Click:** Save

<figure><img src="/files/vCzDingnqEeuYdKaQ9CS" alt="" width="367"><figcaption></figcaption></figure>

1. In the top menu select “**Utterance**” tab, then select “**Create New Utterance**”. Utterance are words spoken to launch specific intents.

**Value:** find product

**Custom App:** Retail Demo

**Intent:** GetProductInfoInput

**Click:** Save

<figure><img src="/files/1BGUSUO3URQ8cR8zg0pF" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/haA4ZGv0LkEbOi0Jww6N" alt="" width="375"><figcaption></figcaption></figure>

1. In the top menu select “Input”, then select “**Create New Input**”.

<figure><img src="/files/1Aa8t5kvUQvEhiLmP2Tv" alt="" width="563"><figcaption></figcaption></figure>

Fill the following details:

**Name:** GetProductInfoInput

**Description:** (leave blank)

**Custom App:** Retail Demo

**Custom Intent:** GetProductInfoIntent

**Data Source:** Retail DS

**Data Source Method:** GetProductInfoMethod

**Click:** Save

<figure><img src="/files/yJ6pW4t8OgCxGgN3h2v3" alt="" width="375"><figcaption></figcaption></figure>

1. Add parameters for the Custom Input GetProductInfoInput.

<figure><img src="/files/p0LehiYADpNVS8Lj1RMi" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/bCirmuwjLSdKtCWcLYRe" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/UHcXYa31Kvq0ejluMUve" alt="" width="375"><figcaption></figcaption></figure>

The Parameter drop down shall select the corresponding parameter described in Method section.

**External App Name:** For instructional purposes we used “Retail Demo”, but this will be the name you create the app in Lex. Therefore, make it unique and different from the names of your other app in Lex.

**Channel:** Lex

**Lex Invocation:** For instructional purposes we used “**retail customer service”**. This will be what users say to launch your skill in Alexa. It must be in lower case alphabets cannot contain **START, BEGIN, STOP, EXIT, LAUNCH** and cannot contain number or special characters.

## **Publish to Amazon Lex**

1. To publish to Amazon Lex, select “**Publish**” in the top menu tabs then click “**Add App Publishing**”. Then input or select the following:

**External App Name**: Retail Demo (This will be the name of the app in Amazon Lex. Therefore, make it unique and different from the names of your other app in Amazon Lex.)

**App Type**: Search

**Channel**: Amazon Lex

**Uncheck the following**: Require account linking, Auto Publish

**Optional**: Replace all placeholder values in all “Message”. Uncheck all the settings shown in the second image below.

**Click**: Save.

<figure><img src="/files/JT4BMYhlmCIoHBWReUJG" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/v7nWxMlnQgA7DgWFjudG" alt="" width="563"><figcaption></figcaption></figure>

Once in Publish App to Amazon Lex select and do the following:

**Selected App**: Retail Demo

External App Name: Retail Demo

Amazon Lex Version: V2

**Select Amazon Lex Account:** Lex Integration Testing

Select the Lex account setup by your admin or the one you set up in step 4 above.

**Click**: Publish To Amazon Lex

<figure><img src="/files/7P10erSN9QcWr5et140J" alt="" width="563"><figcaption></figcaption></figure>

On the resulting screen, ensure that a success message shows for the publishing steps before clicking “**Test Lex**”. If success message not shown, click “**Go Back to App Publishing**” to fix any issue shown in publishing result.

<figure><img src="/files/LhYsnCA2nB42Tok5APv2" alt="" width="563"><figcaption></figcaption></figure>

Query the bot with the Utterance "Find product" and then provide the contact-name of whom you would like to see the phone number, for ex: type Jeremiah. Bot will provide the response with the full name and the phone number.

<figure><img src="/files/tVRKBKOMJWDorjfa8JNh" alt="" width="563"><figcaption></figcaption></figure>

Congratulations!

You have successfully created a Domain App using Internal data.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ixhello.com/ixhc/blueprints/domain-skill-template-using-internal-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
