# API and Mapping

### Step 1: API Manager

When an API is created in the API manager, a [system is chosen](https://docs.dckapintegrator.com/project-manager/systems/api-manager#add-new-api) for the API to be associated with. Also, [sample request and response data](https://docs.dckapintegrator.com/project-manager/systems/api-manager#request-and-response) are given while creating an API.

For more information, click[ here.](https://docs.dckapintegrator.com/project-manager/systems/api-manager#request-and-response)

![Selecting System while adding a new API in API Manager](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6QwZrb4kCqEV52c%2F9.png?generation=1576669314372397\&alt=media)

Now let us see how this API gets linked with the Mapping node

### Step 2: Flows - API Call Handler

The API Call Handler is added to the Flow to make an API call to a system. Depending on the system chosen, you can select an associated API from the drop down list. Any newly added API from [here](https://docs.dckapintegrator.com/project-manager/systems/api-manager#add-new-api) will also be available in the list.

More than one API Call can be added in a Flow.

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6Qxqx5jnQ61iXKj%2F10.png?generation=1576669314404441\&alt=media)

![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6QyuDxJH6-gQp_b%2F11.png?generation=1576669314369364\&alt=media)![](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6QzgkugdOmXaZxh%2F12.png?generation=1576669314370942\&alt=media)

### Step 3: Flows - Mapping Handler

The Mapping Handler is added to link data from a source API to a destination API.

When a Mapping Handler is added to the Flow, you will be choosing two API's (a source and a destination) to map. Note that, only API calls made within the Flow will be available for the user to select from.

![Mapping page showing Source and Destination APIs](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6Qv30w0jaQBZAWo%2F8.png?generation=1576669314507007\&alt=media)

#### Sample Request JSON

```python
{
 "company_id": "string",
 "customer_id": 0,
 "idAlreadyExists": true,
 "id": "string",
 "first_name": "string",
 "last_name": "string",
 "title": "string",
 "direct_phone": "string",
 "email_address": "string",
 "isUpdate": true
}
```

#### Sample Response JSON

```python
{
 "order_no": 225333,
 "shipping_cost": 30.00,
 "status": “paid”,
 "tax": 0,
 "payment_desc": "",
 "shipping_method": "fa",
 "order_date": "2019-10-21T04:13:37.541Z",
 "expiration_date": "2019-10-21T04:13:37.541Z",
 "ship2_name": "Alice",
 "ship2_city": "San Francisco",
 "ship_to_phone": "1234567890",
 "ship2_state": "California",
 "ship2_add1": "",
 "ship2_zip": "94016",
 "name": "Alice",
 "ship2_email_address": "alice@example.com",
 "mail_address1": "Jarvis St.",
 "mail_city": "San Francisco",
 "central_phone_number": "123456790",
 "email_address": "alice@example.com",
 "cancel_flag": false,
 "orderLines": [
 {
 "inv_mast_uid": 2,
 "item_desc": "Plate Set 1",
 "item_id": "QTR12",
 "unit_price": 12.24,
 "extended_price": 0,
 "qty_ordered": 1
 }
 ]
}
```

##

![Choosing APIs in the Mapping Handler](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6R-tNPrElB64zdB%2F13.png?generation=1576669314376383\&alt=media)

### Step 4: Integration Pipes

While adding a new Pipe, you are required to choose System Credentials. Credentials are directly related to a system.

Depending on the Credentials (System) selected, the Flows (with API calls to those systems - Step 2) will be populated in the drop-down list.

![Adding a New Pipe](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6R0Il10sKHlTxYF%2F14.png?generation=1576669314372200\&alt=media)

Depending on the Flow selected, the Mapping nodes will be displayed (only if Mapping handler is added in the Flow - Step 2)

{% hint style="danger" %}
If no Mapping Handler is added in the Flow, Mapping node will not be displayed
{% endhint %}

![Mapping card after Flow is chosen](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6R1cuPe4t90Fq2g%2F15.png?generation=1576669314375167\&alt=media)

### Step 5: Mapping Configuration

Click on Configure. The mapping Configuration window will open.

The Source API fields are populated from its sample **response** and Destination API fields are populated from its sample **request** provided in the API Manager page (From [Step 1](https://docs.dckapintegrator.com/project-manager/systems/api-manager#step-1-api-manager)).

![Source and Destination APIs in Mapping](https://2655769465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2Fpaper-cup%2F-LwNno3bxYy9tekmXcxA%2F-LwNo6R2tJ_8GQGjhsRd%2F16.png?generation=1576669314473960\&alt=media)
