Contact Free trial Login

Simulate Data in REST APIs

Exchange lets you provide simulated data for testing OAS or RAML REST APIs. The simulated data is provided in the Mocking Service feature.

The Mocking Service appears in Exchange:

  • In the API console that appears on the right side of an asset detail screen. The Mocking Service lets you add simulated data to an API function and test the API with the data.

    Mocking in API Console

    This page shows two URLs. The URL on the left is also used in Design Center and is public. The URL on the right is used only in Exchange and requires authentication.

  • Listed as an instance with each version of an API.

    Mocking instance in versions
  • Listed on the API instances page that also lists the Mocking Service URL.

    API Instances Mocking Service URL

Accept Simulated Data in an API

  1. From Design Center > API Specification, provide example data that the implementation returns. Alternatively, you can develop an OAS (Swagger) specification from a text editor and add the example data there.

  2. In the REST specification provide an HTTP status code for a successful API call.

Test a REST API With Simulated Data

  1. In Exchange, click a REST API.

  2. Click a function such as GET.

  3. In the API console on the right of the screen, click Send to send simulated data to the API.

    Send simulated data to a REST function

    Exchange sends the data and lists the response, which in this example returns the HTTP 200 OK status to indicate success, and lists the data that is sent from the API using the simulated data.

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.