> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/navigation/api-tester.md).

# API Tester

The **API Tester** is an interface to interact with the converted Excel to API logic.

The primary use cases for the **API Tester** are for:

1. Business users who own the Excel spreadsheet and logic. The **API Tester** is a calculator for their model, allowing users to conduct interactive form-based unit testing on their models.
2. Developers who need to understand how to integrate with the API.

After choosing a specific service from the [Folder overview](/navigation/folder-overview.md), select the ![API Tester](https://2714190325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc7fek1ZgAUH5MA3m5pH8%2Fuploads%2F5AsSXSzkElIFULhylxy7%2Fimage.png?alt=media\&token=f647f6ce-2fbe-466b-bd17-f342bfda6bbf) icon from the service sidebar.

## Testing

### Send API requests

1. Load the **API Tester** for your service.
2. In **API request (inputs)**, the **API Tester** displays inputs in the **Field view**.
3. The input fields will contain the default values from the Excel file.
4. Enter the desired values for the inputs for the API call. Spark will render a form interface. Each input will have a means to enter values:
   * Inputs can be **Sort alphabetically.**
   * Single cell value `Xinput` can be entered via a textbox or a dropdown menu if the input contains a **Data Validation List**. The form will also attempt to process any dynamic validations where one `Xinput` value will impact the valid list for another `Xinput`.
   * Ranged `Xinput` has a button to open a modal with a grid interface. The dimensions of the multiple-cell range depend on the default values in Excel.
   * `XCSVinput` has a button to open a textbox to enter CSV text.
5. Select **Submit** button to execute the API call.
6. In **API response (outputs)**, the returned outputs will be returned in field view. The **Field view** is separated into expandables for **Single values**, table outputs, **Errors**, **Warnings**, **Transaction details**.

### Change the request and response views

| View             | Requests                                                                                                        | Response                                                                                                                                    |
| ---------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Field view**   | The default view. Inputs and outputs are rendered in a form.                                                    | Outputs are rendered into expandables for **Single values**, table outputs, **Reports**, **Errors**, **Warnings**, **Transaction details**. |
| **JSON view**    | The JSON viewer shows a syntax highlighted request body. Keys and values can be modified through the interface. | The JSON viewer shows a syntax highlighted response body.                                                                                   |
| **Raw view**     | Text editor view of the request body.                                                                           | Text editor view of the response body.                                                                                                      |
| **cURL Command** | Enter a [cURL](https://curl.se/) command. The inputs from the command will be parsed.                           |                                                                                                                                             |

[Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request_meta) modify the behavior of an API call such as passing the `call_purpose` and `source_system`. These can be tested in the **JSON view** or **Raw view**. Note that the `version_id` cannot be changed and that `transaction_date` testing cannot be done through the **API Tester**.&#x20;

### Customize the request

| Key                  | Value                                                                                                                                                                                                                                                                                                                                                          |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Service version**  | Select the service version to test. It is not possible to test the [Manage service versions and effective dates](/build-spark-services/manage-service-versions-and-effective-dates.md) dynamic version selection through the **API Tester**.                                                                                                                   |
| **API format**       | The default **API format** is **V3**. **V1** is available for legacy users.                                                                                                                                                                                                                                                                                    |
| **Endpoint URL**     | This is the endpoint URL to call to execute calculations.                                                                                                                                                                                                                                                                                                      |
| **Custom endpoint**  | Enable a custom endpoint path for this service. See [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#path-parameters).                                                                                                                                                                                                                             |
| **Service type**     | <p>Defines the compiler type to process this API call.</p><ul><li><a data-mention href="/build-spark-services/neuron.md">/pages/qc2ynJ5gnthNAqVrFQRg</a> is the default for all services uploaded to Spark.</li><li><strong>Type3</strong> is offered for legacy purposes.</li><li><strong>XConnector</strong> can make calls to external resources.</li></ul> |
| **Requested output** | Comma separated string containing output names to filter in the response. Find out more in [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md#request_meta) under `requested_output` and `requested_output_regex`.                                                                                                                                   |
| **Subservices**      | Select subservices to execute in the request. Find out more in [Sub functions with subservices](/build-spark-services/additional-mappings/sub-functions-with-subservices.md).                                                                                                                                                                                  |

## Integration

### Generate a Swagger specification

* Spark generates a code snippet based upon [OpenAPI specification 2.0](https://swagger.io/docs/specification/v2_0/what-is-swagger/), formerly known as Swagger.
* Many no-code / low-code platforms can ingest Swagger specifications for API integration.

### Generate code snippets

* Get sample code to integrate API into your application.
* **OpenAPI** option returns a comprehensive [OpenAPI specification 3.1.0](https://spec.openapis.org/oas/v3.1.0.html) for the Spark service.
* Code snippets are also available in 25+ programming languages (such as C#, curl, JavaScript, and Python). The snippets are generated using [postman-code-generators](https://github.com/postmanlabs/postman-code-generators).

## Documentation

### Download API documentation

Spark generates an API specification document for your API. For both [Execute API (v3)](/spark-apis/execute-api/execute-api-v3.md) and [Validation APIs](/spark-apis/validation-apis.md), sections include:

* Authorization
* Request headers
* Request parameters and sample
* Response attributes and sample
* curl statement

The report can be exported as an `HTML` or `PDF` file.
