> ## 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: Insert Usage

> Provides Insert usage on DB-2-API in Apinizer Platform. You can perform single record insertion operations to the database and publish SQL INSERT queries as REST API endpoints.

In this scenario, **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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/01-db2api-settings.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=33309119fcf2bb0e119d8a98b9834dc0" alt="DB-2-API Settings" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-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 selected method is on the right side.

<img src="https://mintcdn.com/apinizer/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/02-db2api-created.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=6314779c967296a5597fd668a6e8c7cd" alt="DB-2-API Created" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/03-add-endpoint.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=993d3dcc9099859dddff25fb0db2056d" alt="Adding Endpoint" width="400" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/03-add-endpoint.png" />

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

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

After entering necessary parameters, the written query can be tested with the **Try It** button.

<img src="https://mintcdn.com/apinizer/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/05-try-it-button.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=f80fe327c7e0d0ed8c1d3d3804af627d" alt="Try It Button" width="400" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/05-try-it-button.png" />

**Visual containing the template returned as test result is provided below:**

<img src="https://mintcdn.com/apinizer/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/06-test-result-template.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=d1d0ca7f65752e4ac5677e1fcb6a6310" alt="Test Result Template" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/06-test-result-template.png" />

## 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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/07-show-specs.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=33692e74e410b7a6b38a6c6d88f5ccc8" alt="Show Specs" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/07-show-specs.png" />

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

<img src="https://mintcdn.com/apinizer/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/08-spec-info.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=df31c50a3f2b10e5063f5d43d2288296" alt="Spec Information" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/09-create-api-proxy.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=23c23ff1dd037a47d8481a0c8accc0bd" alt="Create API Proxy" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/10-api-proxy-creation-form.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=748a28fe370132e41943da4ab2345881" alt="API Proxy Creation Form" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-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/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/11-deploy-dialog.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=5d53268273183fc6269e0a90de5b54b1" alt="Deploy Dialog" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/11-deploy-dialog.png" />

## 5. Testing

When the request is sent without adding the parameters expected by the relevant method, the following error response is returned.

<img src="https://mintcdn.com/apinizer/dh8lJAfe_RHld4EW/images/tutorials/api-olusturucu-senaryolari/db2api-insert/12-error-response.png?fit=max&auto=format&n=dh8lJAfe_RHld4EW&q=85&s=24a6d7be6b7565846784a4ff6261c2b8" alt="Error Response" width="800" data-path="images/tutorials/api-olusturucu-senaryolari/db2api-insert/12-error-response.png" />

When the parameters expected by the relevant method are added to the request and executed, the following response is returned.

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