API Tester

he API Tester in Spark is targeted to two types of users to interact with the converted Excel to API logic:

  1. Business users who own the Excel spreadsheet and logic. The API Tester is essentially a calculator for the model, allowing users to conduct interactive form-based unit testing on their models to ensure they function as intended.

  2. Developers who need to understand how to integrate with the API.

To access this feature, after choosing a specific service from Folder overview, choose the API Tester icon from the service sidebar.

Testing

The first tab within the API Tester is the Testing tab. This provides the capability to make API requests against the converted Excel logic.

Submit API requests

  1. By default the API Tester displays inputs in the Field view.

  2. The input fields will contain the default values from the Excel file.

  3. Enter the desired values for the inputs. Spark will present an appropriate interface based on data type, including:

    • dropdown menus or radio buttons for single-cell fields with Excel data validation.

    • raw text boxes for CSV inputs.

    • a grid interface for multiple-cell ranges. (The dimensions of the multiple-cell range depend on the dimensions of the default values in Excel.)

  4. Click the Submit button to execute the API call.

circle-info

If the Spark service contains dynamic validations that meet the Validation API, changes to an inputs will automatically trigger an update to any associated inputs, e.g. choosing a Country can change a City list.

Select the API request and API response view

Key
Value

Field view

The default view.

The inputs and outputs appear in the format of a form.

JSON view

The API request and API response displayed in a JSON viewer, which makes it easier to traverse through the JSON objects. This view is read-only. Objects can be copied to the clipboard.

Raw view

The request body, displayed as editable plain text.

cURL Command

Enter a cURL command here to provide the API request body.

Change the service version called and the API specification type

  • At the top of the API Tester page, you can choose the service version to test.

  • The default API format is V3, however you can select the legacy V1 API if needed.

Review API responses

  • After the execution of the API is complete, the results appear in the API response area.

  • The View Log button will navigate to API Call History.

Download the Excel file with inputs and formatted outputs

Business users may want to review the specifics of an API call in Excel to review the calculation. Download a copy of the Excel file by clicking the Download the API response as Excel file.

  • Spark will populated input ranges such as Xinput with the fields from the API request.

  • Spark will not populate output ranges such as Xoutput with the fields from the API response. This is to preserve the original formulas.

  • Spark will add tabs containing the formatted API response outputs.

Adjust service parameters

Changing the service parameters affects the API request request_meta parameters. Most users shouldn't need to modify the entries in this section.

Key
Value

Endpoint URL

Find out more in Execute API (v3).

Custom endpoint

Find out more in Custom endpoints.

Service type

Defines the version of the Excel engine used by Spark. Neuron is the default for all new services uploaded to Spark.

Requested output

Used to filter the API response outputs. Find out more in request_meta under requested_output and requested_output_regex.

Subservices

Used to select the How to: Work with subservices to include in the request.

Integration

The Integration tab provides code snippets to help integrate the Spark API with applications.

Swagger

  • "Swaggerarrow-up-right is a powerful yet easy-to-use suite of API developer tools for teams and individuals, enabling development across the entire API lifecycle, from design and documentation, to test and deployment."

  • Many low-code platforms can ingest Swagger specifications for API integration.

  • The Swagger statement from Spark formats the elements that form the API request_data.

  • The "Swagger (Form data)" format includes additional information about field enumeration and validation.

circle-info

The Swagger structure and values may differ depending on the service version and API format chosen.

Code Snippets

The Code Snippet tab provides sample code to help you make API requests from outside of Spark. Code snippets are available in 25+ programming languages (such as cURL, go-Native, Python, JavaScript, etc.) and can be copied to the clipboard or downloaded with one click.

circle-info

The default language in the dropdown menu is cURL, but Spark remembers the last language chosen.

Documentation

The Documentation tab automatically generates an API specification document for your API. It describes the authorization methods and input and output parameters and contains a sample request and response.

You can customize the document in the rich text editor and then export it as a PDF or HTML file.

circle-exclamation

Last updated