Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WACADEMY and version 24.0

With step 1 to 5, you now have set up the following configuration:

The PrivateEchoAPI can now be consumed by Spring Corp.. To calls from Spring Corp. the Gold rate limiting will be applied. It needs to supply an API Key to be able to consume the PrivateEchoAPI.

Now, you are going to test if your API is accessible.

Testing API Access and Policy Functionality

Open the details page of client Spring Corp. and go to tab Contracts.

Click Try .

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNameopen_test_ui
PageWithExcerptINTERNAL:_academy_excerpts

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNameopen_get_method
PageWithExcerptINTERNAL:_academy_excerpts

As displayed in section Curl, the API Key is provided correctly with the cURL 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 PrivateEchoAPI is invokable. Next, you are going to test if the Rate Limiting Policy is applied correctly.

As configured in tutorial step 2, clients using plan Gold should be able to execute 20 requests per minute.

Click Execute more than 20 times in succession.

In section Server response an error is displayed:

  • message: "Rate limit exceeded."
  • headers:
    • X-RateLimit-Limit: shows the number of allowed requests
    • X-RateLimit-Limit-Remaining: shows the number of remaining requests, in our test case the value should be negative.

The API can be consumed as intended.

Panel
titleFollow Our Example User Story

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

Consuming the API

Panel
titleFollow Our Example User Story

David Stringer wants to test the API from the customer's perspective.

To consume the API, the customer Spring Corp. would access it via its client in the Developer Portal.

Open the Developer Portal and go to tab My Clients.


Click API Documentation.

  • In the test UI, execute some GET and POST requests.
  • Then switch back to My Clients.

  • Open tab Policies in your client.

You are testing with your personal client and API Key. Therefore, each test decreases the rate limit that is set by the rate limiting policy.

  • Check that your testing had an impact on the displayed rate limit.
Info

The policy display is loaded initially when you open the tab. If you want to refresh the display, you need to reload the browser window.



Panel

Image Added

Congratulations - you have done it!

You have created your own private API and tested it.

Panel
titleOn this Page:

Table of Contents

Panel
titleRelated Pages:

Otp
Floatingfalse

rprde

Congratulations - you have done it!

You have created your own private
Panel
titleRelated Documentation:
Panel

Image Removed

Div
Styleposition:absolute;bottom:0;
and tested it.