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 Design 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.


    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": "",
          "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": "",
          "company": {
            "name": "Romaguera-Crona",
            "catchPhrase": "Multi-layered client-server neural-net",
            "bs": "harness real-time e-markets"
  5. Click the GET tab for the /userbyid resource. Click Try it, accept the default query parameter ID = 3, and click GET.

    The user information appears for the user having an ID 3.