Nav

To Simulate Calls to the API

This procedure builds on the JSONPlaceholder API example to show you how to use API console to test the API. You see the response example from the user-example.json include file when you preview the response in API Console.

  1. From the API Administration page, click the product version number.

  2. On the API version details page, click Edit API in API Designer.

  3. Above the API console on the right, turn on the Mocking Service.

    In your RAML definition, the baseUri changes to a mocking service URI.

  4. In the API Console, click GET.

    designing-your-api-35775

    Click Try it, then GET to return the example data.

    The user information in your example appears:

    [
       {
          "id": 1,
          "name": "Leanne Graham",
          "username": "Bret",
          "email": "Sincere@april.biz",
          "address": {
            "street": "Kulas Light",
            "suite": "Apt. 556",
            "city": "Gwenborough",
            "zipcode": "92998-3874",
            "geo": {
              "lat": "-37.3159",
              "lng": "81.1496"
            }
          },
          "phone": "1-770-736-8031 x56442",
          "website": "hildegard.org",
          "company": {
            "name": "Romaguera-Crona",
            "catchPhrase": "Multi-layered client-server neural-net",
            "bs": "harness real-time e-markets"
          }
        },
        ...