# DB - API IFlow

#### Introduction

In this I flow the data flows from database to API. We fetch data from database and post the required fields to the API.&#x20;

#### FLOW DIAGRAM

#### INTERFACE NAME: Product\_SwissBake\_Oracle\_DB\_To\_Bizom\_API\_Prod

Requirement: We need to fetch Product data coming from oracle DB and filter the required fields and post the same to Bizom API.

Flow Structure:

#### Step 1: Post the bizom access token API using REST adapter

&#x20;       By using the provided credentials, we will hit the bizom token API and generate token.

The username and password is given for the authentication purpose.

&#x20;

&#x20;       API: [ https://api.bizom.in/oauth/directLogin/xml](https://api.bizom.in/oauth/directLogin/xml)

&#x20;        REQUEST: \<User>

&#x20;    \<username>swissbakemaint\</username>

&#x20;      \<password>Swissb\@ke\</password>

\</User>

#### Step 2: Client Oracle database

Database path :oracle.jdbc.driver.OracleDriver|jdbc:oracle:thin:@41.218.83.178:11553:ORCL|BTBSFA|salesapp

The database path  contains the connector name, Database name,IP address of the client database and database credentials to establish the connection.

We get all the data present in the given time range when we retrieve the data using select query using the Database Adaptor.

&#x20;We need to map the fields using response formatter to fetch the required fields from the database.

In step setting we have to give column count based on the columns which we are fetching and a stored procedure call.

<br>

![](https://lh5.googleusercontent.com/4t2_NkLApW5y6uhg-xsZaSE_-w1QkqwFHRVzM4GMqrLxbMYHlJX_7GUoDNUems0pmxVfJoIVkI-t81AWArB0g6tkYMTzpgY5Gx60uH8VMGw-35m2jdZrMJ1r2S-I7RGcu1apyn-l9Vs)

<br>

#### &#x20;Step 3: Posting to Client API

API:[https://api.bizom.in/skunits/add/xml?access\_token=${configs\['0'\].values\['1'\]\['Token](https://api.bizom.in/skunits/add/xml?access_token=$%7Bconfigs\[%270%27].values\[%271%27]\[%27Token)']}

We post data fetched from the client database to Bizom API using the rest adaptor by formatting the request in request template.

Here client db retrive step is given as parent ID because after posting one record it goes back to the parent step to fetch another record.

Response type is based on response from the Client API after posting the data. Here it is custom\_XML.

UPDATE\_SUCCESS\_COUNT, so that number of success records is updated.

STEP\_SEARCH\_CRITERIA, This is configured so that we can find any particular record in Step history by giving the key field in request search criteria of step history.

NOTE:  The Request template should not be null it should contain an empty space at least.


---

# 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://oresund-integration-platform.gitbook.io/oresund-integration-platform/about/product-and-developer-guide/sample-description-of-i-flows/db-api-iflow.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.
