Get started with API Connect

Get started with API Connect

Course Features

Course Details

Business organizations are going through a digital transformation to accelerate innovation, unlock new markets, and drive new revenue. These enterprises are making their business services and data available through APIs to various types of developers: internal, partner, and third-party. These APIs are then consumed by developers to build mobile, web, Internet of Things, business partner, and internal line-of-business applications for end users to use. IBM® API Connect™ helps you manage critical components of the API lifecycle for both on-premises and cloud environments. By using API Connect, you can create, run, manage, and secure APIs and microservices. This course introduces you to API Connect. You’ll learn how to quickly create APIs in IBM Bluemix and use API Connect tools to customize, analyze, manage, and secure APIs.
Get started Lab 1: API Connect and IBM Bluemix

Lab 2: import API Lab 3: create an API that uses JSON

FREE
Create Assembly
6 of 9
Click Assemble. Hover the mouse over the invoke placed in the assembly by default and click the Trash can icon to remove it. Scroll down to see the available web service operations. Drag the checkRequest operation onto the assembly line. Two map operations and an invoke are created automatically. Click the map policy on the left of the invoke. Click the Pencil icon in the input column. Click input. Set the following properties: Field Type Context variable request.body.CheckRequestElement Content type application/json Name CheckRequestElement Definition #definitions/JSONCheckRequest When you’re finished, click Done. Click the circle button next to Amount in the Input list. Click the circle button next to the Amount in the Output list. Map the remaining inputs to the remaining corresponding outputs. For example, click the circle buttons for PayorAccountNamefrom the Input list and click the corresponding PayorAccountName in the Output list, and so on. Close the Map configuration window. Save your changes by clicking the Save icon. Click the Invoke policy action. Set the Target URL to the following URL. Copy this URL exactly, substituting only the x in id=x with the client ID value you noted earlier. Make sure there are no spaces in the URL. https://$(api.endpoint.address)/$(api.org.name)/$(env.path)/bankback/checkRequest?client_id=x. Close the Invoke configuration window. Click the second Map policy. Then, click the Pencil icon in the output column. Click Output. Set the content type to application/json and set the definition to #definitions/JSONCheckResponse. Then, click Done. Map the input fields to their corresponding output fields. Close the configuration window when you’re done. Save your changes.

Lab 4: secure access to an API by using OAuth

Lab 5: enhance content with data

FREE
Create an additional database connection
6 of 9
In this section, you will create a connection to an additional database of information, which will provide information related to the record being inserted in the weatherwatchers database, thus enhancing the data recorded. Drag the Operation-Switch policy onto the Assemble line before the Weatherwatchers Invoke. Select get /reports for case 0. Click + Case. Then, select post /reports for the operation. Close the operation-switch configuration pane. Drag the existing Weatherwatchers invoke icon down onto the get /reports line. Drag a set-variable policy action onto the Assemble line for the post /reports operation path. In the Set Variable configuration pane, enter location in the Set field. Enter lat=x&lon=y in the Value field. Then, close the Configuration pane. Drag a gatewayscript policy action onto the line after the Set Variable. Enter the following code to examine the inbound report and set the variable value to the latitude and longitude values that are contained in the report. The comments shown in the illustration are optional. var nlatlon = \"lat=\" + apim.getvariable('request.body').location[0] + \"&lon=\" + apim.getvariable('request.body').location[1]; apim.setvariable('latlon', nlatlon); Close the gatewayscript configuration page. Drag an invoke policy action onto the line after the gatewayscript. Set the URL to: https://api.us.apiconnect.ibmcloud.com/developmentoperations-apiconnect/sb/weather/forecast?client_id=7551f520-72a3-45ac-a5b8-5ecc52712584&$(latlon) Save your changes. Then, click the test arrow. Click Republish product. Select the post /reports operation. Scroll down and enter a sample weatherwatcher forecast. Here is a sample: {"location":[34, 45], "date":"2016-09-22T07:00:00+0500", "observed":"Hot rainy low 70 high 90", "watcher":{"name":"Bob", "email":"[email protected]", "city":"Here"}} Click Invoke. The result contains a forecast for the location. Close the Test pane.

Summary

More Courses by this Instructor