> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DB-2-API: Batch Insert Usage

> Provides Batch Insert usage on DB-2-API in Apinizer Platform. You can perform bulk data insertion operations and add multiple records in JSON list format to the database with a single request.

In this scenario, **Batch Insert** usage on DB-2-API in Apinizer Platform will be explained.

To get more information about creating DB-2-API, [click here](/en/develop/api-proxy-creation/api-creator-db-api-creation).

## 1. Creating DB-2-API

An API that manages employee records is desired to be created.

The name and description fields of DB-2-API are filled and the **Save and Next** button is clicked.

**Visual containing DB-2-API settings is provided below:**

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/01-db2api-settings.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=5141880219ec3c103e0e526975ee1bce" alt="DB-2-API Settings" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/01-db2api-settings.png" />

When DB-2-API is created, API and method information is on the left panel, and definition information of the relevant method is on the right side.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/02-db2api-created.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=0870b2aca1261f3ad7fc812ab504d7c7" alt="DB-2-API Created" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/02-db2api-created.png" />

## 2. Creating Method

Click the **Add** button to open the method/endpoint creation panel.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/03-add-endpoint.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=60548533932f24b7393fbeb2799759d1" alt="Adding Endpoint" width="400" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/03-add-endpoint.png" />

**Visual containing method creation settings is provided below:**

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/04-method-creation-settings.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=6a29afb47f763cc30e301bf1d326e9c9" alt="Method Creation Settings" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/04-method-creation-settings.png" />

After writing the query statement, necessary parameters are entered and example usage can be seen by pressing **Show Sample Message Body**.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/05-show-sample-message-body.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=28ec70a05c1aca71a733d023b99e4843" alt="Show Sample Message Body" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/05-show-sample-message-body.png" />

**Visual containing sample message body is provided below:**

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/06-sample-message-body.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=1131e8eca0ada696fd2cadf0d70332d1" alt="Sample Message Body" width="600" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/06-sample-message-body.png" />

<Note>
  As seen in the sample message body, in **Batch Insert** usage, data must be entered as a **JSON list**.
</Note>

## 3. Viewing API Definition Documents

Click the **Show Specs** link to access the API definition files belonging to Employee Db-2-API.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/07-show-specs.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=2646e99521d56e102bbfe617580a02ee" alt="Show Specs" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/07-show-specs.png" />

**Visual containing Spec Information dialog is provided below:**

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/08-spec-info.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=d07cbafcb7298f9f752d0ca122fd82d8" alt="Spec Information" width="600" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/08-spec-info.png" />

## 4. Creating API Proxy

An API Proxy can be created instantly by clicking the **Create API Proxy** button from the DB-2-API screen.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/09-create-api-proxy.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=c6dbc43fb8f43eefe4542c34cad36334" alt="Create API Proxy" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/09-create-api-proxy.png" />

When creating the API Proxy, fill in the input fields shown in the visual below and click the **Save** button.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/10-api-proxy-creation-form.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=76246a6b5c6c5096de1922b76ca5d7c6" alt="API Proxy Creation Form" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/10-api-proxy-creation-form.png" />

### 4.1 Going Live with API Proxy

Employee API Proxy can be quickly loaded (deployed) onto the defined environment and opened for client consumption.

This operation can be managed through the dialog opened by clicking the **Deploy** button on the API Proxy screen.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/11-deploy-dialog.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=ed07f55ea85adf8d8487e4b9e7c2873a" alt="Deploy Dialog" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/11-deploy-dialog.png" />

## 5. Testing

A JSON list is sent as Body type for testing.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/12-test-request.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=3b54e87d2a28d1e444899f8888406a23" alt="Test Request" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/12-test-request.png" />

When the parameters expected by the relevant method are added to the request as Body type and sent, the following successful response is returned.

<img src="https://mintcdn.com/apinizer/WYMI3puEVZ6s2nRQ/images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/13-success-response.png?fit=max&auto=format&n=WYMI3puEVZ6s2nRQ&q=85&s=5369b0631c654349bb23f9cdde9a740a" alt="Successful Response" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-batch-insert/13-success-response.png" />
