Contact Us 1-800-596-4880

Testing the API Spec with the Mocking Service

logo cloud IDE Cloud IDE

logo desktop IDE Desktop IDE

Open Beta Release: The cloud IDE is in open beta. Any use of Anypoint Code Builder in its beta state is subject to the applicable beta services terms and conditions, available from the IDE.

Use the Mocking Service in the API Console to check the GET request and response that you configured for American Flights API in Adding Examples to the API Spec.

Before You Begin

If you haven’t started the American Flight API specification, complete these procedures before attempting to test:

Test Your API Specification

  1. In Anypoint Code Builder, open the RAML file for your American Flights API specification (american-flights-api.raml).

  2. Click the API Console icon in the editor toolbar:

    API Console icon highlighted in the editor toolbar
  3. In API Console, select the get method for the flights/ resource:

    get method for the flights/ resource highlighted in the API Console
  4. Click Try It:

    Try it button highlighted in the API Console
  5. Select the destination text box inside Query Parameters and verify that the three values you defined in your API specification appear:

    Values highlighted in the API Console
  6. Click Send.

  7. Verify that the API Console returns the response you defined with the imported fragment (AmericanFlightsExample.raml):

    A 200 OK response highlighted in the API Console

    The logic for selecting specific destinations is not yet implemented.

    Optionally, review your configured response examples when querying your mocked API endpoints.

  8. Proceed to Publishing the API Spec to Anypoint Exchange.