To Simulate Calling the API (Mocking) in Visual Mode

Requires November 2017 Release

This procedure builds on designing the RAML root, a data type, and resource in visual design mode.

In this procedure, you simulate calling the API. If you turn on the mocking service and send a request to the API, the mocking service returns the example response you specified in the API.

  1. In the RAML code pane, turn on the mocking service.

    mock on

    The base URI changes to from the JSONPlacholder service URL to a mocking service URL, such as{num}/

  2. Click Try It next to RAML Viewer at the bottom of the RAML code pane.

    If the method you are trying to test has errors, Try It for that method is disabled; otherwise, if there are parameters, as there are in this example, the Parameters prompt appears.

  3. Provide a parameter between 1 and 5. For example, enter 2.

    try it v
  4. Click Send.

    A status 200 and the example response you specified during design is returned.

    example returned

Now, you are ready to publish the design to Exchange.

In this topic: