Developing APIs on API Connect - 101 - Proxy a Rest Service
Part of One of the API Development Series. In this part we will show screenshot by screenshot how to create a very basic API.
Requirements
- API Connect Manager or the API Designer with the API Connect Local Test Environment up and running.
-
Access to the internet from your DataPower or API Connect Local Test Environment
- Sample URLs (If the first URL is no longer available please use the second)
- http://apic-test-app.eu-gb.mybluemix.net/api/balance?id=1001 (Created by Ben Cornwell)
- https://httpbin.org/anything?id=100
Steps
-
Goto the API Drafts by clicking on this button after logging into the API Manager.
-
Click on Add -> API
-
Click on Next
-
Set the following parameters
Title Get Balance
Description This API returns the Balance for a given account id
Target Service URL http://apic-test-app.eu-gb.mybluemix.net/api/balance?id=1001 -
Click on Next
-
We are going to start with the default security options. Click on Next
-
Click on Edit API
-
The API is now created and we need to publish it.
a. If you are in the API Designer Press this button
b. If you are in the API Manager Web Interface
i. Goto Assembly.
ii. Click on the Play button
iii. Click Activate API -
Testing the API
a. If you are in the API Designer, follow the instructions on this page to Test the API. https://chrisphillips-cminion.github.io/apiconnect/2019/09/21/APIConnect-LTE.html
b. If you are in the API Manager Web Interface
i. Scroll Down and click on to Invoke -
You will see a response similar to
{"balance":998155}