Lab prerequisite: “Create and Secure an API to Proxy an Existing REST Web Service”
In this lab, we will take the API created in the “Create and Secure an API to Proxy an Existing REST Web Service” lab and publish it to a Developer Portal where it will be ready for consumption by application developers.
We will begin by creating a new catalog and configuring the Developer Portal for our Customer 1.0.0 Product. We will then define a new Plan in the Product and publish to our new Developer Portal.
In this lab, you will explore the following key capabilities:
Configure the Developer Portal and publish the APIs
Create a Portal Account
Create an application and subscribe to a Plan
Test the API in the Developer Portal
A Developer Portal for the Sandbox catalog has already been configured in this environment.
1. Click on **IBM Cloud Pak | Automation** in the upper left. |
2. Navigate to the API Connect instance.
3. If first time logging in the login page is presented Click Common Services User Registry.
2. Click on Manage catalogs. If you are already logged in and continuing from the previous lab, click on the Home icon on the left navigation bar.
3. Click on Sandbox.
4. Select the Catalog settings tab.
5a. From the left menu, click on Portal. Click on Create.
5b. Select a portal-service from the drop-list. And click Create button
6. Copy the Portal URL and paste it in a new browser tab. Note: If you get a warning message that your connection is not private, follow the instructions in the previous section.
7. The IBM API Connect Developer Portal provides consumers access to API Catalog information. This gives application developers the opportunity to explore and test APIs, register applications, and subscribe to Plans.
A Portal Administrator can customize the look and feel to their organizational specifications. The default Developer Portal looks like the image below. Note: Depending on what you have published, the Products that you see may be different.
8. Some Products are visible to all users without an account depending on the Product visibility setting. Additional options are available when you log into the Developer Portal.
The portal is setup for self service so we will create a new account as a developer. You can create an own account. To do so, click on Create an account.
9. Fill in the form and make sure to use a valid email address since that is where the activation email is sent. At the bottom when done, click Sign up.
10. You will receive an email that you will copy the link and paste in to your browser to complete the registration at which point you can log in.
11. Go to Sign in and enter the Username and Password created. Click Sign in.
1. Once you are logged in, you can explore various sections in the Developer Portal. Click on Explore API Products.
2. The Products that you see in your Portal may vary from what is shown in the lab images. Click on Customer 1.0.0. This is the Product that we published in the “Create and Secure an API to Proxy an Existing REST Web Service” lab.
3. You will see the API and Plan that is associated with the Customer 1.0.0 Product.
IBM API Connect enforces entitlement rules to ensure that consumers are allowed to access the APIs that are being requested. In the following steps you will register your consumer application and subscribe to an API Product.
1. Click on Apps.
2. Click Create new app.
3. Give your application a title (e.g. Customer Demo) and click Save.
4. When your consumer application is registered in the IBM API Connect system, it is assigned a unique set of client credentials. These credentials must be provided on each API request in order for the system to validate your subscription entitlements. The Client Key can be retrieved anytime but the Client Secret can only be retrieved at this time.
Make note of your Client Key and Client Secret by click on the copy icon for each.
NOTE: copy these to notepad since you will need the Client Secret in a future step.
Click OK.
At this point, your registered consumer application has no entitlements.
In order to grant it access to an API resource, you must subscribe to a Product and Plan.
1. Click on API Products.
2. Click the Customer 1.0.0 Product.
3. Click on Select for the Default Plan.
4. Select the application (e.g. Customer Demo) that you just created. Note: The number of applications that you see in your environment may differ.
5. Review the subscription information and click Next.
6. Click Done.
The API Connect Developer Portal allows consumers to test the APIs directly from the website. This feature may be enabled or disabled per-API.
1. You should be on a screen that shows the API and Plan for the Customer 1.0.0 Product. If you are not on this screen, click on API Products in the top navigation and select the Customer 1.0.0 Product.
2. Click on the Customer Database 1.0.0 API.
3. Click on the GET /customers operation.
4. On the right, you will find information about the request parameters and links to the response schemas. Click the Try it tab.
5. If you only have one application registered, it will be automatically selected in the API Key drop-down menu. If you have more than one, select the application (Customer Demo) which is subscribed to this API Product.
Paste your Client Secret in the API Secret field.
Click Send.
6. Scroll down to see the call results.
Note: If running for the first time, you may see Code: 0 No response received. Causes include a lack of CORS support on the target server, the server being unavailable, or an untrusted certificate being encountered. Clicking the link below will open the server in a new tab.
If the browser displays a certificate issue, you may choose to accept it and return here to test again.
7. Feel free to test the rest of the operations. Testing will be similar to the testing that was completed in the “Create and Secure an API to Proxy an Existing REST Web Service” lab.
Congratulations, you have completed the Developer Portal Experience lab. Throughout the lab, you learned how to:
Navigate to the Developer Portal
Create a Portal account
Create an application and subscribe to a Plan
Test a API in the Developer Portal