Use Case of API Gateway - shephertz/App42_APIGateway_Docs GitHub Wiki

Use case - Create API , Apply Authentication and Test API and View Specs:

Here is a simple use case which defines how you can create your API with proxy type and Apply Key based Authentication and how you can test your API with Generated SDK. You can also test your API on the go with Test Specs and view section.

Steps:

  1. Go to APIs -> Manage and create an API of Proxy type.
  2. Enter the mandatory fields and provide the endpoint for the API .
  3. Click on Submit.
  4. GO to Policies -> Authentication and select Authentication Type as KEY and click on submit.
  5. GO to API - > Settings , select your API , enable Authentication and Select Authentication Policy which you have created in step 4
  6. Go to IAMs -> Manage , create your IAMs
  7. Go to IAMs -> API Mapping , click on MAP API to attach your API with the IAM and click on submit.

The above steps will create your API , attach authentication policy and will map your API with the IAM.

Now to Test your API and authentication on API , you can do it either with SDK or with the Test API Section.

Test Specs and View Specs Section:

  1. Go to Test Specs and View Specs Section: Choose your API. You can see the specs of your API with all the methods.

  2. Select Your API method which you want to hit.

  3. Provide the API Key (API Key is your IAM Key)

  4. Click on Try it out and you can see the response of the API.

Similarly you can Test your API with the Generated SDK.

Generate Code Section:

  1. Click on Generate Code.
  2. Select your API and Platform(In this case lets select Java) on which you want to generate SDK.
  3. Click on Generate and it will download the SDK for your API configuration with all the details .
  4. Unzip the java SDK. search for the io.swagger.client.api package , here you will find the class with your API name .
  5. Open the file and here you can see the different method definitions to call your API(). This file will have methods with all the allowed methods and authentication parameters which you have configured for your API.