Examples Intro

For simplicity, we will assume that the installation of API Simulatorâ„¢ is under the root directory. Adjust the directory paths accordingly if the installation is in a different directory.

We recommend adding the API Simulator scripts to the command path. While you don’t have to do this, it will make running the examples a bit easier.



Starting API Simulator for an Example Simulation

Start an API Simulator instance by executing the apisimulator script passing in the start argument, and fully qualified path to the simulation’s directory or path relative to the current directory:

On Linux, the command starts API Simulator in the foreground. On Windows, the command starts API Simulator in a new Command Prompt window.

API Simulator listens for requests on its default port 6090. The API Simulator’s Admin Server, which allows for clean shutdown of the simulator, runs on its default port 6190.

Stopping API Simulator

To stop API Simulator when done running an example simulation, execute:

Running the Examples

The online examples use cURL – a well-known command line tool for “…transferring data with URL syntax” over various protocols (see https://curl.haxx.se/). It is included in many Linux distributions. You can download the latest version here, including for Windows. Please see the cURL documentation for a description of the command line arguments.

Another way to run the examples is by using the simple API Client tool distributed with API Simulator. The README.txt file in the directory of each example contains more information.

Notice that double quotes surrounding API Simulator script arguments are required if directory paths or file names contain any spaces. Double quotes inside cURL command line arguments are escaped (\”).