# Custom App Series - Step 1 - Building a Custom App

## Objective

The purpose of this document is to describe how to create an app in the iX Hello. After going through this document, you should be able to create custom app for channels such as Amazon Alexa, Google Assistant, Amazon Lex, Twilio and Slack.

## Pre-requisites

You should have a connection and/or a Data Source established.

## Scenario

You want to build an Amazon Lex app where you can ask for a person’s phone number. All the phone numbers are stored in a Data Source, and for simplicity of this documents, it is assumed that the user has established a connection between the Data Source and the iX Hello Platform

We want to create an app where the following commands should return a phone number:

*“Get phone number for John Doe?”*

*“Find me the contact number for Doctor John Doe.”*

## Terminologies

* Intent
* Utterance
* Slot
* Entities
* Methods
* Input

### Intent

Intent is the task the user wants to accomplish. Intent is not a specific word; it is the overall goal the user is trying to achieve. In our example, our intent is to find a phone number by name.

### Utterance

A user can convey an intent by saying various phrases. In our example, we are going to use the two above mentioned utterances.

### Slots

Slots are variables contained in intent. In our example, the slot is the name of the person whose phone number we are trying to find.

!\[A screenshot of a cell phone

Description automatically generated]\(<https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fvoiceworx-ai-api%2F-Mkb6FOD6Z0RA2WYMr-s%2F-Mkb6jprFc_w4bMZfPn6%2F0.png?generation=1632743916970319\\&alt=media>)

### Entities

Entities are the synonyms/variations for the slots. They define the various ways a user can specify an intent. For example, in our use case, the user can say the name of the person as ‘John Doe’ or ‘Doctor John Doe.’

### Methods

Methods are the tasks performed on the database. Examples are search, put, push, delete etc.

### Inputs

Inputs are slot mappings to the methods. iX Hello gets ‘slots’ from channels such as Lex, Google Assistant or chatbots and then has to map these to the methods for task execution. Inputs can contain multiple Input parameters.

## Step 1: Create an App

Creating a custom app that can be consumed from an external platform like Lex, includes the following steps

* Connect System (Data Source Integration)
* Create App
* Create the App Methods
* Add intents to the App
* Add Slots to the App
* Define Utterance
* Define Input
* Create Entities for App Slots (This is optional)

## Step 2: Set up a Data Source

1. Login to the iX Hello platform, go to Integration menu and select Connect System. In the resulting page, click connect external systems

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F4CRo2jQm00FKSwnVtM62%2Fimage.png?alt=media&#x26;token=70fc729c-1706-4515-a794-d044f0c0562d" alt=""><figcaption></figcaption></figure>

2. In the resulting popup, under choose connection dropdown select “Rest API Service” then click connect system.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FUXQ32GFjTiRbixFMzu5Y%2Fimage.png?alt=media&#x26;token=8d1bbfc0-c438-48f6-af21-36627572dbaa" alt=""><figcaption></figcaption></figure>

3. Add the web API endpoint, username and password and click “Validate System” to ensure you have access to the web API endpoint.

**ApiName:** ContactFinder

**Authorization Type:** No Auth

**Base API URL:** jsonplaceholder.typicode.com/

**Click Save**

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FIzAsVP6dLSbTGsnVk7Ta%2Fimage.png?alt=media&#x26;token=4c62454e-e557-4ee7-a84b-e7831a0b628a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FheQeKdy5eOaW9vPUrRlr%2Fimage.png?alt=media&#x26;token=4f9c7709-bfe1-4af9-a9c1-d04eaf9e2c47" alt=""><figcaption></figcaption></figure>

## Create Custom App in iX Hello

1. To create a custom app in iX Hello, click on “Apps” menu and select “Custom Apps”.
2. Click “New Custom App” button

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2Fy8T3UxHHbwgbzgqVcXwm%2Fimage.png?alt=media&#x26;token=c652cee8-3b49-48f8-9d24-3455801d7e5c" alt=""><figcaption></figcaption></figure>

3. Provide following details and click on Save.

**Name:** ContactFinder

**Custom App Type:** Search

**Category:** None

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FdDtW7M85eFC3zwyDQfHH%2Fimage.png?alt=media&#x26;token=0e002043-73e0-446f-9b38-102829d3d145" alt="" width="563"><figcaption></figcaption></figure>

4. In the top menu tabs, select “Data Sources” then “Create New Data Source”. Provide the following details:

**Name:** ContactFinderDS

**Integration Configuration:** Rest API Service : Contact Finder (integration configured in Step 2)

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F9K2ZnuvZ5tQUGokllzf9%2Fimage.png?alt=media&#x26;token=089ee6d6-cd43-44b8-8ef0-4e9ee3c2eec2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F5cEpHxZMjO5URdmwOvJp%2Fimage.png?alt=media&#x26;token=5b7fcc08-2ce5-4bde-951e-7c5be28a67bd" alt="" width="563"><figcaption></figcaption></figure>

5. Click on methods and create new methods. Enter the following in the fields
   1. **Name**: GetPhoneNumberByName
   2. **Request Type**: GET
   3. **Query Path**: ?name={{Person}}
   4. **Result Type**: ListofRecords
   5. **Method Path:** users
   6. **Record Template:** {{name}}, {{phone}}
   7. **Record Json Path:** $.\[\*]
   8. **Record Limit:** 10
   9. **Valid Result Template:** {{Records}} How else can I help you?
   10. **Empty Result Template:** How else can I help you?

![](https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fvoiceworx-ai-api%2F-Mkb6FOD6Z0RA2WYMr-s%2F-Mkb6jpzrzlEiV9zURHa%2F8.png?generation=1632743917021608\&alt=media)

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FDewgZIl5jVJnodS2r6ax%2Fimage.png?alt=media&#x26;token=770a4389-501f-4901-992a-8b5f3dc9d526" alt=""><figcaption></figcaption></figure>

6. Let’s test if the method is extracting the contact information correctly. Click on Test button.

Fill the following parameter and click on Method Test, then on Result section, click on Result tab.

**Person:** Leanne Graham

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F5bFWcCQpKb8h2GZEpokG%2Fimage.png?alt=media&#x26;token=a6a66175-0ff6-48bc-a06a-ba38a28710b5" alt=""><figcaption></figcaption></figure>

## Step 3: Creating an Intent

Note: If the use-case requires the Orchestration intent creation, then follow [this](https://docs.ixhello.com/ixhc/connections/orchestration-enhancement-lex-nlp-bot-integration) document.

Navigate to the ‘Intents’ tab and click on the ‘Create New Intent’ button.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FXnNBvjrwYflyouo2EpRw%2Fimage.png?alt=media&#x26;token=d88d9ee0-5cf8-49ca-be34-c2b525c9f5b2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FdnjSGF6DcFbmCmJA5UZ0%2Fimage.png?alt=media&#x26;token=cf1d83e8-d8c5-4b66-a371-edf676960679" alt="" width="563"><figcaption></figcaption></figure>

| **Parameter**      | **Sample Value**     | **Info**                                      |
| ------------------ | -------------------- | --------------------------------------------- |
| Name               | PhoneByName          | Any name that conveys the intent              |
| Intent Type        | Search/Custom/Survey | Purpose of the intent                         |
| Intent Action      | Execute Method       | Action that the user wants to perform         |
| Data Source        | Drop-down list       | Select the respective Data Source             |
| Data Source Method | Drop-down list       | Select appropriate method for the Data Source |

## Step 4: Create Slot

Navigate to the ‘Slots’ tab and select your intent from the drop-down list. Then click on the ‘Create New Slot’ button.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FGzHEfgMmDrRYK8704E5f%2Fimage.png?alt=media&#x26;token=862844f1-06c3-4659-8128-5fbc5d42ff0d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FG3hpJyYzSNk9PWux8nE9%2Fimage.png?alt=media&#x26;token=596936ca-0f4c-463d-88c8-1aab2106a667" alt="" width="563"><figcaption></figcaption></figure>

| **Parameter**    | **Sample Value** | **Info**                                       |
| ---------------- | ---------------- | ---------------------------------------------- |
| Name             | Person           | Any Name for the slot                          |
| Reprompt Message | person name?     | Message to display when slot is not understood |
| Type             | Text             | Select type of variable from drop-down         |
| Custom App       | ContactFinder    | The app associated with the slot               |
| Intent           | PhoneByName      | Intent associated with the slot                |

## Step 3: Creating Utterances

Navigate to the ‘Utterances’ tab and select the intent from the drop-down list for which you’re creating utterances. Then click on ‘Create New Utterance.’

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2F36esz2oTKVoeCKe2B9sX%2Fimage.png?alt=media&#x26;token=6c827152-7f95-4b74-9477-3eccdf89f958" alt=""><figcaption></figcaption></figure>

**Important:** To insert slot in an utterance, type **‘{‘**&#x61;nd a drop-down of available slots will appear.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FuGbQouJ4aS1vdyC0KRxt%2Fimage.png?alt=media&#x26;token=ee030a52-5858-445f-bf68-ea6c6f1e0c99" alt="" width="563"><figcaption></figcaption></figure>

| **Parameter** | **Sample Value** | **Info**                              |
| ------------- | ---------------- | ------------------------------------- |
| Value         |                  | Utterance that will invoke an action  |
| Custom App    | ContactFinder    | The app associated with the utterance |
| Intent        | PhoneByName      | Intent associated with the utterance  |

You can add as many utterances as you would like.

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FPdzaz3UTPoQJqiKRoLlG%2Fimage.png?alt=media&#x26;token=9df72880-f838-4241-a532-34fb34397a1c" alt=""><figcaption></figcaption></figure>

## Step 4: Mapping Inputs

Navigate to the ‘Inputs’ tab and click on ‘Create New Input.’

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2Fmf53Xt8GdZ0zoAjmu4D8%2Fimage.png?alt=media&#x26;token=09aecce2-71eb-4215-8e08-1f34991f5ec5" alt="" width="375"><figcaption></figcaption></figure>

| **Parameter**      | **Sample Value** | **Info**                              |
| ------------------ | ---------------- | ------------------------------------- |
| Name               | Person           | -                                     |
| Custom App         | ContactFinder    | The app associated with the input     |
| Intent             | PhoneByName      | Intent associated with the input      |
| Data Source        | ContactFinderDS  | Data Source associated with the input |
| Data Source Method | Person           | Data Source method you want to invoke |

<figure><img src="https://1107164708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M8XHvUsfyTUFLvToHqD%2Fuploads%2FEp99YGm8IRxMVS8IMJDk%2Fimage.png?alt=media&#x26;token=fbcab070-e4fc-499e-95e2-6cc3e31f9592" alt=""><figcaption></figcaption></figure>


---

# 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/apps/custom-skills-series-step-1-building-a-custom-skill.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.
