# How to create an incoming web API

**URL:** <https://community.triggre.com/t/how-to-create-an-incoming-web-api/779>\
**Category:** Connections\
**Tags:** web-api, actions, designer, connections, flow-parts\
**Created:** [December 31, 2019, 11:00pm UTC](https://community.triggre.com/t/how-to-create-an-incoming-web-api/779 "2019-12-31T23:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mar](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.triggre.com/mar/32/395_2.png) [@Mar](https://community.triggre.com/u/Mar)\
**Post date:** [December 31, 2019, 11:00pm UTC](https://community.triggre.com/t/how-to-create-an-incoming-web-api/779/1 "2019-12-31T23:00:00Z")

</div>

If you want to provide other people with an API to your Triggre application, you can do so by creating an **Incoming Web API**.

## Step 1: creating the Incoming Web API

1. Create an **Automation flow** with a **Connection Triggre** as the start:  

2. Add any **Properties** you want as **Inputs**. Please note you can not use **Data items** , only **Property types** such as **Text, Number** and **Date** :  

3. Complete your **Automation flow** and publish your application.

## Step 2: locating your Web API

In order to call your new Web API, you first need to know the URL where it is available. The URL that Triggre generates uses the following template:

- https://{application}/{environment}/interfaces/rest/{automation flow name}/{automation\_flow\_name\_with\_underscores}

Let’s take a look at the following example:

- Application: _[example.triggre.net](http://example.triggre.net)_
- Environment: **Lab**
- Flow name: _My first incoming Web API_

This would mean that Triggre creates an incoming Web API for you on the following URL:

- [Triggre - Application not available](https://example.triggre.net/lab/interfaces/rest/my) first incoming web api/my\_first\_incoming\_web\_api

> Tip: The **Automation flow part** of the URLs is case-insensitive (after the _/rest/_ part), so whether you use capitalized words or not, doesn’t matter.

## Step 3: calling your incoming Web API

To call your Web API, you will need to use a **POST request** with the data you want to supply as JSON. Make sure to set the **Content-Type header** of your request to _Application/json_.

Triggre uses **Basic Authentication** for incoming Web APIs, which means you will need to provide a **Username** and **Password** by sending them in a header:

- Authentication: Basic _Base64Encode(“username:password”)_

For more details on how Basic Authentication works, see this [Wikipedia article](https://en.wikipedia.org/wiki/Basic_access_authentication). To find the **Connection credentials** to use, see our article [Finding your connection credentials](https://docs.triggre.com/lessons/finding-your-connection-credentials).

The data you send must be structured as a JSON object. For example, if our incoming Web API has only a single **Input** , a text named _Example input_ then the data you send should look like this:

![Example input](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/d1543dc19fab9af25ee7515be5b661045e352676.jpeg)

The incoming Web API will return a status code of 200 on success, and any data you have configured as **Output** as a JSON object as well.

### Supported types

| Triggre property | JSON type |
| --- | --- |
| _ **Texts** _ | |
| **Any text** | string |
| **Email** | string |
| **URL** | string |
| _ **Numbers** _ | |
| **Number (no decimals)** | number or string\* |
| **Number (1-6 decimals)** | number or string\* |
| _ **Dates & times** _ | |
| **Date** | string, formatted\*\* as:   
YYYY-MM-DD  
DD-MM-YYYY  
 DD/MM/YYYY  
DD.MM.YYYY |
| **Date & time** | string, formatted\*\* as:   
YYYY-MM-DDThh:mm:ssZ  
 YYYY-MM-DDThh:mm:ss+hh:mm  
DD-MM-YYYY hh:mm:ss  
 DD/MM/YYYY hh:mm:ss  
 DD.MM.YYYY hh:mm:ss  
 DD-MM-YYYY, hh:mm:ss  
 DD/MM/YYYY, hh:mm:ss  
 DD.MM.YYYY, hh:mm:ss |
| **Time of day** | string, formatted\*\* as: hh:mm |
| **Duration** | string, formatted\*\* as: hh:mm:ss |
| _ **Files** _ | |
| **Any file** | object with url\*\*\* property, e.g. { “Url”: “[https://some.file](https://some.file)”} |
| **Document** | object with url\*\*\* property, e.g. { “Url”: “[https://some.document](https://some.document)”} |
| **Picture** | object with url\*\*\* property, e.g. { “Url”: “[https://some.image](https://some.image)”} |
| _ **Other types** _ | |
| **True/false** | boolean |
| **Pick list** | string, value must correspond to pick list value |

\*) You can use a string for very large numbers, that are not natively supported. In most cases, just a number will be sufficient.  
\*\*) Date time notations used per the [W3.org date time standard.](https://www.w3.org/TR/1998/NOTE-datetime-19980827)  
\*\*\*) Note that the Url property is case sensitive and must start with a capital, then lower case letters.

### Example

Below is an example of how to format these types as a single item, and as a list of items:

 ![Example overview](https://canada1.discourse-cdn.com/flex035/uploads/triggre/original/1X/dd62622655ae9759494e6a07144bc4f175bbb14f.png)
