# Example of API Requests

This section provides you with examples of how to send requests to the API. The examples cover a range of common use cases, demonstrating the required format and parameters for each request. In this section we will be seeing GET,POST,PUT, DELETE

### API Automation Execution

To automate API execution, follow these steps for the [initial](/scriptlessautomation/get-started/start-with-automation.md) setup. After completing the initial setup, you can trigger automation either through IntelliJ/IDE or via Maven commands. Before executing the automation, it's crucial to update two parameters from the configuration files: '`Platform`' from '`testNgConfiguration.properties`' and '`TEST_TRAIL_IDS`' from '`testManagementConfiguration.properties`'. These changes are necessary to enable the automation to identify that it is meant to automate API testing and to specify which specific test cases to pick.

***Note*****: If TestRail is not available in your project, it is advisable to disable it.**

#### Automation Configuration

<figure><img src="/files/ynsYVKsDOX5mfg650hyf" alt=""><figcaption></figcaption></figure>

After setting up the above configuration trigger automation through maven or intellij

#### Running through intellij

To run automation through maven one should need to create a configuration in intellij

<figure><img src="/files/tprZhKP3IbSWCoiDsnpC" alt=""><figcaption></figcaption></figure>

* **Main Class**: `runner.ScriptLessApplication`
  * The entry point of the automation process.
* **CLI Arguments**: `true`, `[registered email]`, `[token]`
  * `true` specifies execution through Maven and `false`  specifies not executing through maven.
  * `[registered email]` should be the user's registered email address.
  * `[token]` is a secret key distributed via email.

While setting up configuration keep `false`, `[registered email]`, `[token]`for more details read [here](/scriptlessautomation/automation-import-notes/points-to-remember.md#ide-run-configuration)


---

# 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://docs.precisiontestautomation.in/scriptlessautomation/automation-platforms/scriptlessapi-automation/example-of-api-requests.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.
