# One Time Urls

One-time URLs are used to receive data. When you need a party to send back data to the app, you give them a one-time URL.

![mini-app2](https://docs.uchat.com.au/assets/img/app2-44.322eb1c9.png)

By generating an URL and sending it out, the app is telling others, to reach back, send the data to this URL.

This is convenient to receive data from anywhere and anyone. However, as the name specified, the URL is one-off. You will need to generate a new URL for each future reception of data. The URL expires after **using** or **time up** (5-60 mins, default: 10 mins).

A one-time URL consists of 3 parts,

| Part                  | Description                                                            |
| --------------------- | ---------------------------------------------------------------------- |
| Parameters (optional) | To receive data and map them to app fields                             |
| Web Forms (optional)  | To collect extra information via a web form                            |
| Web Page              | To display confirmation messages for previous parts and call a subflow |

{% hint style="info" %}
Note

**Parameters** and **Web Forms** sections are both optional. You are free to have a one-time URL only receiving data or only collecting data via a form.
{% endhint %}

### Create One Time Url <a href="#create-one-time-url" id="create-one-time-url"></a>

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2F37ZShox8zNGIlaGkhxqD%2Fapp2-31.6258112c.png?alt=media&#x26;token=d11eaded-eeb2-44f5-829d-73929a1cd6dc" alt=""><figcaption></figcaption></figure>

Follow steps 1 to 5 in the above screenshot to edit the One Time Url.

### Parameters <a href="#parameters" id="parameters"></a>

In the parameter section, you can see the **Sample Json Payload** area. Here is where you tell the app, what does the data to receive looks like. In that way, we can specify where to save the received data in advance.

You can fill in the sample JSON payload by

* manually put it in
* listen to real-time data

![mini-app2](https://docs.uchat.com.au/assets/img/app2-45.e2181f4e.png)

For example, in the screenshot above, the JSON data with 3 values included is manually put in.

To get real-time data, click on the **Listen to data payload** button and copy the sample URL for testing. One-time URL supports both the GET and POST method.

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FV9RGUXavJFzxyeigeswY%2FJSON.png?alt=media&#x26;token=b8d339c2-a53a-448d-aab1-f11ef0d82354" alt=""><figcaption></figcaption></figure>

Give it a live test and attach this sample URL. For example, in your browser, visit:

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FunIGxMfxEHp3pMSdC2Ll%2FSample%20Link.png?alt=media&#x26;token=dc489e7d-da58-47f8-9993-91f2cfdcbd7b" alt=""><figcaption></figcaption></figure>

You will see a blank page when you hit return since you haven't designed the confirmation **Web Page** yet.

Back to the **Listen to payload** window after the test and click "Done":

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2F3dfTJwv8x1LeJvFwkNyw%2FJSON%20SAMPLE.png?alt=media&#x26;token=a970e9b1-d16f-42a1-8a6c-bf4123474ae6" alt=""><figcaption></figcaption></figure>

You will see your real-time data received in the sample JSON payload area.

![mini-app2](https://docs.uchat.com.au/assets/img/app2-49.e7081c38.png)

Click on **Preview Payload** and let's map them to app fields:

![mini-app2](https://docs.uchat.com.au/assets/img/app2-38.42b0a1ef.png)

To map data:

1. click on the data in the left-side sample data area
2. JSON path shows on the right side
3. create a new field by typing in a new name then click on the new name or search an existing field
4. click on the **Add** button to add to the mapping list

### Web Forms <a href="#web-forms" id="web-forms"></a>

Click on **Add Item** to start adding inputs of the web form.

![mini-app2](https://docs.uchat.com.au/assets/img/app2-52.67f8ce86.png)

| Parameters        | Description                                                                                                                                                                                                                                                   |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Unique Name       | Unique in all auth inputs, you are unable to insert a space. Use underscores or hyphens to separate words                                                                                                                                                     |
| Type              | Choose **String** for text without carriage returns, **Number** for integer or float numbers, **Text** for text with carriage returns, **Select** for [static or dynamic source](https://docs.rapidbott.com/help-center/mini-apps/mini-app-2.0/sources) input |
| Title             | Title shows on the user interface                                                                                                                                                                                                                             |
| Required?         | Is this input a must? if not, switch off and provide a default value if needed                                                                                                                                                                                |
| Save to App Field | Specify where to store the value. Create a new app field right here by typing in a new field name and selecting a field type in the pop-up, or search an existing field                                                                                       |
| Placeholder       | Grey prompt shows in the input box                                                                                                                                                                                                                            |
| Description       | Black prompt shows under the input box                                                                                                                                                                                                                        |

Add as many web form inputs as you need, click on **Save** when you finish. Have a check on the **Preview** area.

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FzIieaPPr1qScsitP1RNB%2FUntitled.png?alt=media&#x26;token=b308e6a9-e712-4ae9-a94b-f421455d3f54" alt=""><figcaption></figcaption></figure>

### Web Page <a href="#web-page" id="web-page"></a>

Design a simple web page for displaying confirmation messages.

![mini-app2](https://docs.uchat.com.au/assets/img/app2-53.fe84014f.png)

Choose an **Url Expiry** time for your one-time link from 5 minutes to 60 minutes. By default, the link expires in 10 minutes.

Finally, select a subflow to run after the web page is displayed.

![mini-app2](https://docs.uchat.com.au/assets/img/app2-54.6ef97a7f.png)

Usually, we fire a trigger in this subflow, to notify chatbots about the update.

<figure><img src="https://2144409983-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHbDmB8MlZRo4hzrDiO0X%2Fuploads%2FepuGADpO85zkPXffEZV3%2Fapp2-55.37dd3d47.png?alt=media&#x26;token=da6e28d6-dcea-4cd8-9631-023d8b10c9e6" alt=""><figcaption></figcaption></figure>

### Generate One Time Url <a href="#generate-one-time-url" id="generate-one-time-url"></a>

![mini-app2](https://docs.uchat.com.au/assets/img/app2-56.c0b57c5f.png)

Use an **Action Step** to generate the URL and save it in an app field for sending out later.
