Testing the API Spec with the Mocking Service
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
-
In Anypoint Code Builder, open the RAML file for your American Flights API specification (
american-flights-api.raml
). -
Click the API Console icon in the editor toolbar:
-
In API Console, select the
get
method for theflights/
resource: -
Click Try It:
-
Select the destination text box inside Query Parameters and verify that the three values you defined in your API specification appear:
-
Click Send.
-
Verify that the API Console returns the response you defined with the imported fragment (
AmericanFlightsExample.raml
):The logic for selecting specific destinations is not yet implemented.
Optionally, review your configured response examples when querying your mocked API endpoints.
-
Proceed to Publishing the API Spec to Anypoint Exchange.