The PublicEchoAPI_Stringer can now be consumed. You are going to test if your API is invokable. Testing is done in the API Developer Portal, but you have easy access from within API Management.

Testing API Access and Policy Functionality

Open tab Overview of the API details page. In section API Endpoint click Try! 

The test UI opens in a new browser tab.
Refer to the Swagger homepage for more information about the functions of the Swagger UI.

At the top of the page, the Base URL and the link to the API definition are displayed.

Expand the displayed operations to start testing.

Open the GET /HelloWorld method.

Click Execute to test the GET request.

In section Curl you can see the actual call.

In the Response body section, you can see the actual response of the service. The call returned the string Hello World! along with the current timestamp.

Now you know that the PublicEchoAPI is invokable. Next, you are going to test if the Ignored Resources Policy is applied correctly.

As configured in tutorial step 3, consumers of the API should not be able to execute POST requests on resource /HelloWorld.

Open method POST /HelloWorld. Enter a value for the required paramter aString , e.g. Testing tutorial 1.

Click Execute.


In section Server response an error is displayed:

  • type: "NotFound"
  • responseCode: 404
  • message: "Requested path \"/HelloWorld\" has been ignored."

The API can be consumed as intended.

Follow Our Example User Story

You now can inform David that the API is published and ready to use.


Consuming the API

Follow Our Example User Story

Now that the PublicEchoAPI has been published, David Stringer wants to test if it is visible to all visitors of the API Developer Portal and can be used by everyone.

Good to Know

The API Developer Portal allows you to grant customer developers access to your APIs. In the Developer Portal, developers can sign up for APIs, access them, and try out APIs that you have enabled for them. The portal is designed to keep the discovery and use of APIs simple for the target group. 

Refer to API Management Guide > Developer Portal for more details.

Open the API Developer Portal of your PAS installation and make sure that you are not logged in with your PAS user.

Recommendation: Open the portal in an ingocnito window of your current browser or open it in a different browser.

In the Marketplace, search for your PublicEchoAPI_Stringer

Click Learn more.

The API details view opens.

Click API Documentation to open the test UI.

Try to execute a POST request.

Enter the required parameter and click Execute.

Check the response.

The API works if the string has been passed but the Response body shows the 404 NotFound error.

From the details view, you can directly copy the Public Endpoint to consume the API.

Important Note on Public APIs

Once you have published a public API it is available online and can be consumed by everyone.
If you have tried this tutorial on your own system, we therefore recommend that you disable or delete the created API afterwards if the customer system is accessible to the public. If you want to follow our recommendation, see Step 5: Disabling the API.

  • No labels