API gateway WSO2

Wso2 is used to design,create,publish and manage API’s.It supports API publishing, lifecycle management, application development, access control, rate limiting and analytics in one cleanly integrated system.

Before you begin, there are some pre requisites.

1.Install Oracle Java SE Development Kit (JDK) version 1.7.* or 1.8.* and set the JAVA_HOME environment variable by following this :

jdk7 Installation in 3 steps

2.Download WSO2 API Manager by using this link: Download wso2 Api Manager

3.Start the API Manager by going to /bin using the command-line and executing wso2server.bat (for Windows) or wso2server.sh (for Linux.)

Invoking/Publishing First API

1.Open the API Publisher (https://:9443/publisher) and sign in with admin/admin credentials.

2.Select the checkbox “I have an existing API”.

3.Select the checkbox Swagger URL and paste this url:  http://<host_name>:<Port_Number>/<Project_Name>/v2/api-docs and then click on button Start Creating.

4.This will import all the API’s listed in swagger documentation and click on implement button.

5.Click on the managed API and set the specific attributes like load balancing,fail over and enable CORS etc and lastly, click on manage button.

6.Set the Transport HTTP , response caching and the below mentioned parameters shown in screenshot.

7.Lastly, click on save and publish button.

Subscribing First API as Consumer

Now that the API is published, consumers should be able to see it and subscribe to it through the API Store.

1.To access the API Store, open a web browser and type the URL: (https://:9443/store) and sign in with admin/admin credentials.After sign in,you can see your published API’s and click on the same.

2.After clicking on the published API,either select or create Application and then subscribe it. Here,the application means the authorization token for the API’s under one application will be same.

3.We need to find the access token to call API’s. For that,after clicking on subscribe,there will be a pop up shown below and click on “Go to my Subscriptions”

4.There will be an application listed there,click on that and go to the tab “Production Keys” and you will get your Access Token.

5.Go to API’s tab and then overview tab,you will find your base url and you can use that for the further calling of API’s. Now, you can call your API’s with postman extension.