Nav
You are viewing an older version of this topic. To go to a different version, use the version menu at the upper-right. +

To Consume a REST Service

This procedure assumes you set up an API, designed an API, and then simulated calling the API. Because you provided a baseURI in the RAML definition, you can get the actual data from the service, for example JSONPlaceholder instead of the example data in your user-example.json include file. You turn off the mocking service, which provides a mock implementation of the API, and use the actual baseURI.

  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. Turn off the mocking service in API Console.

  4. Save all files in the project.

  5. Configure a proxy and deploy the API to Cloudhub.

  6. Issue the following call in a browser to get the actual user list:

    http://placeholder.cloudhub.io/users

The actual user list from the JSONplaceholder site appears.

Alternatively, you can use Try It in API Console to get the actual user list.

In this topic: