API Configuration allows users to create scripts using API(s). The user can also able to either use the existing script or upload the OpenAPI(Swagger)/Postman/HAR script.

In API Configuration, there are two tabs for Imported scripts:

- Design
- View Script

## DESIGN

When Design is selected, then the user will use UI to create/modify the API group. In the design tab, there are the following fields:

### Request List

It contains groups and groups contains multiple request list. User can add group in two ways:

1. Design Manual: In Designer mode, Users can add, edit or delete an API/ URL(s)/ Requests from UI. User can create script using UI. They can also parameterize the script.
2. Import Scripts: In import scripts, the user can import an existing script from the current workspace, or import third-party scripts like OpenAPI(Swagger), Postman and HAR.

Users can select their preferences by either Uploading a Script from the desktop or can Browse Cavisson Script.

In Group, we have the following fields:

- Group Name: In Group Name, the user can provide the name of the group.
- Number of Users: In this option, the user must define the total number of users.
- Script Name: It will show the script name. It is only applicable in case there is an import of the Cavisson script.
- Pre Script: Pre-scripts run before the execution of the script. Users can write custom code and these codes will be copied into init_script.c or init_script.java according to script type, so that it will run before the script execution.
- Post Script: Post-script runs after the execution of the script. Users can write custom code and these codes will be copied into exit_script.c or exit_script.java files according to script type, so that it will run after the script execution.
- Manage Parameters: On clicking Manage Parameters, the parameters UI will display where a list of all parameters and assertions will be shown. Here user can add, Update and delete parameters/assertions. On clicking “Add Parameters” and “Add Assertions”, the parameters and assertions UI will open respectively in the sidebar.

Note: Pre script, Post Script, and Manage Parameter is only applicable to Design Script Manually group.

In Request, we have the following fields:

- Method: The user can add method types like GET, PUT, POST, DELETE, PATCH, OPTION, HEAD, CONNECT, and TRACE.
- URL: It is the HTTP request URL. It is a link/Url, where the API will communicate with. Users should be able to enter URL in a given text field.
- Request Name: It is the HTTP request which can only be added to a group.
- Think Time: Think time can only be added between two requests.
- Revert Changes: In this you can undo the changes done earlier.
- Show Additional info: If you want to add any header or Body to the request then click on the Show Additional Info option, there are two tabs:
  - HEADERS: In the header, the user has to provide the key-values.
  - BODY: In the body, the user has to pass the request body. The request body can be passed in the following format:
    - Text: In this format, the request body is sent in the form of text.
    - JSON: In this format, the request body is sent in the form of JSON.
    - HTML: In this format, the request body is sent in the form of HTML.
    - JavaScript: In this format, the request body is sent in the form of JavaScript.
    - XML: In this format, the request body is sent in the form of XML.
    - Form Data: : In this format, the request body is sent in the form of either Text or File. In Text, the user can send the body in text form, and in the file, the user has to select a file from their desktop.
    - URL Encoded Form: It is the format in which the data will be passed to the server.
      The details filled in by the user in the above parameters will be displayed in the Group Details section.
- Manage Inline Request
  You can see all Inline Requests in the table and you can also add Inline Requests. The following action items can be performed on Inline Requests:

- EDIT: In order to edit an inline, we will click on the edit icon, and then values will be filled on top of the table, like this, and after updating, click on the update button to apply changes to the inline request’s table.
- DELETE: This option will delete an inline request from the table and also from the particular request.
- REPEAT INLINE: This option will open a dialog box, where a user can add repeat inline by parameter or by count.
- SET TRANSACTION NAME: This option will also open a dialog that asks for the transaction name of the selected inline as a transaction name for an inline is not mandatory.
- SPLIT PAGE: This option will make an inline a main request and all inline requests below it will become inline of the newly created request. It will ask for Inline URL Transaction Name via dialog if the inline request doesn’t already have a name.
- ADDITIONAL INFORMATION: This option will open a pop-up window from where you can add the headers and body to the inline request.

Note: Click on the icon next to the Request List if you want to add groups or additional settings.

## VIEW SCRIPT

When View Script is selected, the user can see the flow file and runlogic of the imported script. User can't edit the flow and runlogic of the existing script.