# Build Custom App

Now let's build an app that interacts with the REST API integration.

## Create App

On the left navigation, go to Apps-> Custom Apps -> New Custom App.

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

<figure><img src="/files/v2tEambBVohDnC8NjqbK" alt="" width="355"><figcaption></figcaption></figure>

## Data Source

This step is where you connect the integration with REST API to your custom app. You are creating a data source which your app will feed from.

Once the app is created and is available on your list of custom apps, click on it to discover the setup for the app.

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

Go to Data Sources tab and click on Create New Data Source.

On the resulting pop up, provide a unique data source name and on the Integration Configuration, make sure to select the integration you created in [prerequisites](/ixhc/general/use-cases/contact-finder-with-rest-api/prerequisites/integrate-api-service-with-ix-hello.md).

<figure><img src="/files/7g13yHJFhQaxH8lY55C3" alt="" width="477"><figcaption></figcaption></figure>

Click on Save to save the data source.&#x20;

## Method

Now let's create some methods that interact with the APIs.

The request type of method depends on the data source.&#x20;

On the Methods tab, click on Add New Method. Also note that, on the Data Source drop down, the data source created in the preceding step is selected.&#x20;

A custom app can have multiple data sources, integrating with multiple third-party systems.

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

### a. GetContactMethod

You are setting up on which endpoint you want to send request to and how you want the result output to be presented to the user.

Please fill in the details as suggested:

METHOD INPUT:

Name: GetContactMethod

Request Type: GET

Method Path: /users

Query Path: ?name={{Person}}

METHOD OUTPUT:

Result Type: ListOfRecords

Record JsonPath: $.\[\*]

Record Template: {{Records}}

Record Limit: 10

METHOD RESULT:

Valid Result Template: You can contact {{name}} at {{phone}} How else I can help you?

Empty Result Template: Sorry, I could not find {{Person}} How else I can help you?

Click Save

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

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

Save and Test will save the method and lead you to a screen where you can test if the method is providing the correct result.&#x20;

Anything inside "{{}}" is read as an input. So, on the test screen, the user is allowed to provide value for the input.

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

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

Once you're convinced that the method is now functioning correctly, move to next step to create intents.

## Intents

On the intent tab, click on Create New Intent. On the resulting pop up, fill in following details and save.

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

## Slot

Next step is to create slots. You create slot corresponding to each input parameter. In our case, Person / name is the input parameter we are expecting from the user.&#x20;

Go to Slots tab and click on Create New Slot.

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

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

Note: The slot name shall match with the input parameter name in method screen.

## Utterances

Utterances are what we expect the user to say to the app to request for something.&#x20;

On the Utterances tab, click on Create New Utterance.

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

Fill the details and click on Save. Now, let's create Input corresponding to the intent.

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

### Input

Create a new input from the Input tab. Add-in following details and click on Save.

<figure><img src="/files/O4C8Jho5PMlTazjTRTgV" alt="" width="322"><figcaption></figcaption></figure>

Once you've created the input, the next step is to manage parameters for the input.

#### Manage Parameters

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

Click on manage Parameters and in the resulting screen, click on Add Input Parameter. You need to create Parameters corresponding to every slot.

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

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

You shall be able to see the created parameter in the list of parameters.

<figure><img src="/files/0Gz3olPQDcgmrI8JtrWw" alt=""><figcaption></figcaption></figure>

## **Publish to Amazon Lex**

Now that the app has been setup, let's prepare to publish it to Alexa. You can publish the same app across multiple channels by creating separate publish profiles.

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

Once the profile is ready, click on the action button and click Publish to Amazon Lex.

<figure><img src="/files/2iTAcr9DcuP8BhlhTqWx" alt=""><figcaption></figcaption></figure>

On the resulting screen, select the Amazon LWA account you want to publish the app to and click on Publish to Lex V2.

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

If you do not already have, you can click on Add New Lex Account and proceed from there.

On successful completion, you'll get a message regarding the status of app deployment. You'll also get a step-by-step progress on the app deployment.

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

You can now click on Test Lex Bot and proceed testing the app.\
Once clicked on "**Test Lex Bot**", you will be redirected to App Publishing screen, and the Test Bot will appear at the right corner showing the App name along with the welcome message:

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

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

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

Congratulations!

You have successfully completed building Lex Custom App.


---

# 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/general/use-cases/contact-finder-with-rest-api/build-custom-app.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.
