> For the complete documentation index, see [llms.txt](https://docs.qyrus.com/service-virtualization/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qyrus.com/service-virtualization/dynamic-assets/build-dynamic-asset.md).

# Building Dynamic Asset

Let's click on the "Dynamic API" button and start with Dynamic Asset Creation.

![DynamicAssetCreate](/files/FQEn7Q3vcXWpo3jI1WaK)

## Contents

* [Building Dynamic Asset](#building-dynamic-asset)
  * [Basic Mode](#basic-mode)
    * [Get Method](#get-method)
    * [Post Method](#post-method)
    * [Put Method](#put-method)
    * [Delete Method](#delete-method)
    * [Additional Features](#additional-features)
  * [Next Steps](#next-steps)

***

After clicking on the "Dynamic API" button you'll be redirected to the below page.

![Landing Page](/files/5AXbfzgWlwHlJDaDvMnN)

We have two methods for building APIs:

1. [The Basic Mode](#basic-mode)
2. [The Advanced Mode](https://github.com/QQyrus/Service-Virtualization-User-Documentation/blob/QA/Dynamic%20Assets/Advanced%20Mode.md)

Let's take a closer look at each option separately.

***

### Basic Mode

By default, Basic mode will be selected. Let's take a look at each field mentioned in the above image.

1. **API Name**

   Give a Proper API name from which you can identify its use case.
2. **Context Path**

   Give Context Path which you want to be present in the generated API URL.
3. **Mode**

   Because we're investigating API creation using the basic mode, keep it chosen.
4. **Request and Response**

   In this part, your API will create data. There are two things you need to consider here:

   * **Number of Rows**: Specify the number of rows you wish to generate.
   * **Data Fields**: Include and choose the type of information you want from the dropdown. For instance, you can select Firstname, CompanyName, Country, and more. Please make sure to provide the right names for these fields.

For example, check the below screenshot.

![BasicModeExample](/files/nnN8v2wymZiglsj6waX0)

After you've completed entering all the information, press the "Save" button to create the data.

You'll find the generated data in the "data preview" tab on the right panel.

![DataPreview](/files/pwHr6Wgel7dC9TJPyKCX)

> The ID field will be automatically created for performing various actions such as POST, DELETE, and more.

Once data generation is done and no more modification is required, you can click on the "Generate API" button to generate your Dynamic APIs.

![GenerateAPIButton](/files/1Q2QGXiRxHVIMmi9dhUe)

After clicking on the Generate API button, You'll see a couple of new information below like the URL.

![GeneratedAPIs](/files/eszZVmfeNMha8xOxj2T0)

URL consists of ***our endpoint + unique identifier + your given context path***

You have the option to utilize that URL for accessing dynamic APIs anywhere outside of qyrus as well as other functionalities it offers.

***

### Get Method

You can click on the "Send" button to hit the Get method of that API and see the result.

![HitGetRequest](/files/I3qXwf1lgLysGKW6xDz9)

![GetAPIResult](/files/GeE5Wrv4KgDMMdWLw945)

As shown in the above result, you'll find a couple of things such as,

* Status Code
* Response Time
* Response Data

***

### Post Method

To utilize the POST method, you need to consider the following points.

* Provide the mentioned header for every POST request made with dynamic APIs `Content-Type: application/json`
* Provide Request body for post method

for the above example you can provide a request body like this

```
{
    "country": "India",
    "city": "Bangalore",
    "company": "Qyrus"
}
```

> Don't provide ID as it'll be auto-generated for all records.

Give the above information and click on the "Hit" button. You'll see the below result.

![POSTExample](/files/lOX1xjzOMcYbpJiKu4AM)

![PostAPIResult](/files/WVndhYxfYwrG5Z0soyEl)

In the above result, you can notice 2 things which are...

* Status Code is 201 which is for newly created data in data source
* ID is 31 because we already had 30 records. so the newly created record is the 31st.

***

### Put Method

To utilize the PUT Method, you need to consider the following points.

* In Path Param give the ID for which you need to update the record
* Provide the mentioned header for every POST request made with dynamic APIs `Content-Type: application/json`
* Add the request Body which you need to update.

Let's continue the above example and give this request body

```
{
    "country": "Bharat",
    "city": "Bangalore",
    "company": "Qyrus"
}
```

Give the above information and click on the "Hit" button. You'll see the below result.

![PUTExample](/files/9S4GvQrkhd7cTQYMe6ke)

![PutAPIResult](/files/zI1QTslku8VYfSUTVJ8d)

In the above result, you can notice 2 things which are...

* Status code is 200 which is a success response
* In response to data, the Country is changed to 'Bharat' from 'India'.

***

### Delete Method

To utilize the DELETE Method, you just need the ID of the record.

You can pass the ID as Path Param and hit the request it'll delete the record.

for example, Let's delete the above-created record whose ID is 31. so give 31 as the Path param and hit the request and the result should be shown as below.

![DELETEExample](/files/a1kULLtjFoxhykk4QNh5)

![DeleteAPIResult](/files/Yh8VGeGZp7SbUoL2aXS4)

Here you can notice the status code is 200 which means the record is deleted. You can verify it by hitting Get Request.

***

### Additional Features

1. **Wild Card Search**

   You can perform wild card searching with the help of any data. for example,

   * Search by Path Param using Country Name `GET /shipdata-amazon/Japan`
   * Search by Path Param using ID `GET /shipdata-amazon/21` and So on...
2. **Pagination**

   You can perform Pagination using Dynamic APIs. for example,

   * Fetch 2nd-page data where on page there should be 10 records `GET /shipdata-amazon?_page=2&_limit=10`
3. **Filter**

   You can Filter data using Dynamic APIs. For example,

   * Filter data by Query Param using Company Name `GET /shipdata-amazon?company=Unilogic`
4. **Sorting**

   You can Sort the all records as well as shown below.

   * Sort the data using the company name and in descending manner `GET /shipdata-amazon?_sort=company&_order=desc`

***

### Next Steps

[Explore Dynamic APIs with Advanced Mode](/service-virtualization/dynamic-assets/advanced-mode.md)
