# API and Mapping

### Step 1: API Manager

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

For more information, click[ here.](/project-manager/systems/api-manager.md#request-and-response)

![Selecting System while adding a new API in API Manager](/files/-LwNo6QwZrb4kCqEV52c)

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](/project-manager/systems/api-manager.md#add-new-api) will also be available in the list.

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

![](/files/-LwNo6Qxqx5jnQ61iXKj)

![](/files/-LwNo6QyuDxJH6-gQp_b)![](/files/-LwNo6QzgkugdOmXaZxh)

### 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](/files/-LwNo6Qv30w0jaQBZAWo)

#### 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](/files/-LwNo6R-tNPrElB64zdB)

### 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](/files/-LwNo6R0Il10sKHlTxYF)

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](/files/-LwNo6R1cuPe4t90Fq2g)

### 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](/project-manager/systems/api-manager.md#step-1-api-manager)).

![Source and Destination APIs in Mapping](/files/-LwNo6R2tJ_8GQGjhsRd)


---

# 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.dckapintegrator.com/developers/api-and-mapping.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.
