Productize Services
Create and manage API products to productize your published services. Each API product consists of at least one published services with OpenAPI specification.
Creating API Products from published API7 Gateway services streamlines development workflows. Changes to published services are automatically reflected in the associated API Products, eliminating the need for manual updates and saving significant time and effort. Developers can focus solely on API consumption without being concerned with underlying service configurations or plugin details.
This tutorial demonstrates how to create an API product for internal developers and outlines the subscription process.
Prerequisites
- Install API7 Enterprise.
- Activate license with API7 Portal enabled.
- Have a running published service.
Add OpenAPI Specification
Select Published Services of your gateway group from the side navigation bar, then click the service you want to modify, for example, a no-version
httpbin
service.Under the published service, select OpenAPI Specification from the side navigation bar.
Click Upload OpenAPI Specification.
Fill in the form:
- Use the following OpenAPI specification:
httpbin.yamlopenapi: 3.0.0
info:
title: HTTPBin
description: A simple HTTP request and response service.
version: 1.0.0
servers:
- url: https://httpbin.org
paths:
/ip:
get:
summary: Returns GET request information
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Get'
components:
schemas:
Get:
type: object
properties:
args:
type: object
headers:
type: object
origin:
type: stringClick Save.
To avoid authentication conflicts, please do not enable any authentication plugins within the published service. API Product configurations will handle authentication.
Please make sure that the OpenAPI specification matches your published services:
- The
Servers
field in the OpenAPI specification corresponds to theHosts
field in the published service. - Each
Path
defined in the OpenAPI specification must match a specificpath
andmethod
combination within a route.
Add API Product
- Switch to API7 Provider Portal using the button on the top-left corner of the navigation bar.
- Click Add API Product, then select From API7 Gateway.
- Fill in the form:
- In the Name field, enter
httpbin
. - In the Authentication Type field, choose
Key Authentication
. - Close the Subscription Auto Approval switch.
- In the API Hub List Visibility field, choose
Visible to logged-in developers only
. - Open the Unsubscribed developers can view API details switch.
- Click Add Linked Gateway Service.
- From the dialog box, do the following:
- In the Gateway Group field, choose your target gateway group. For example,
default
. - In the Published Services field, choose your target service. For example,
httpbin
. - Click Add.
- In the Gateway Group field, choose your target gateway group. For example,
- In the Name field, enter
- Click Add.
- By default, newly created API Products are in a
draft
state and are not visible on the Developer Portal. Click Actions button at the top, then select Publish. - Click Confirm.
Developer Requests Subscription
- Use a developer account to log in to the Developer Portal.
- Select API Hub from the top navigation bar.
- Select
httpbin
. - Explore the API details to ensure they meet specific needs.
- Click Subscribe Now.
- Wait for approval.
Provider Accepts Approval
- Select Organization from the top navigation bar, and then select Approvals.
- Click Accept of the specific request.
Developer Validate API
- Use a developer account to log in to the Developer Portal.
- Select API Hub from the top navigation bar.
- Select
httpbin
. - Click Test Request.
- The Auth Type is pre-selected, and the API key is automatically filled in, copied form the developers' credential.
- Click Send.
- Receive a
200
response.
Additional Resources
- Key Concepts