|
| 1 | +--- |
| 2 | +title: "Package APIs for partners with Dev Portal" |
| 3 | +description: "Learn how to package existing APIs in Dev Portal into API packages for partners." |
| 4 | +content_type: how_to |
| 5 | +related_resources: |
| 6 | + - text: About Dev Portal |
| 7 | + url: /dev-portal/ |
| 8 | + - text: Dev Portal API packaging reference |
| 9 | + url: /dev-portal/api-catalog-and-packaging/ |
| 10 | +automated_tests: false |
| 11 | +products: |
| 12 | + - konnect |
| 13 | + - dev-portal |
| 14 | + |
| 15 | +works_on: |
| 16 | + - konnect |
| 17 | +tools: |
| 18 | + - deck |
| 19 | +tags: |
| 20 | + - api-catalog |
| 21 | + - api-composition |
| 22 | + |
| 23 | +tldr: |
| 24 | + q: How do I create API packages from existing Dev Portal APIs? |
| 25 | + a: | |
| 26 | + Packaging APIs involves the following steps: |
| 27 | + 1. Create an API and attach an OpenAPI spec. Operations from your API's OpenAPI spec should overlap with Routes to ensure requests will be routed to the correct Service. Gateway routing configuration isn't directly modified by adding operations. |
| 28 | + 1. Link a control plane to allow developer consumption. |
| 29 | + 1. Apply the Access Control Enforcement (ACE) plugin globally. |
| 30 | + 1. Create an API package by adding operations and package rate limits. Operations are automatically mapped to Routes using your API's OpenAPI spec or you can create them manually. The Gateway configuration isn't directly modified– any unmatched operations will be highlighted to indicate that a user Gateway Manager permissions needs to perform an action. |
| 31 | +prereqs: |
| 32 | + show_works_on: false |
| 33 | + inline: |
| 34 | + - title: "{{site.konnect_product_name}}" |
| 35 | + include_content: prereqs/products/konnect-account-only |
| 36 | + icon_url: /assets/icons/gateway.svg |
| 37 | + - title: "{{site.konnect_short_name}} roles" |
| 38 | + content: | |
| 39 | + To recover create API packages, you need the following [roles](/konnect-platform/teams-and-roles/): |
| 40 | + * Editor role for APIs |
| 41 | + * Publisher role for the API and API package |
| 42 | + * API Creator |
| 43 | + icon_url: /assets/icons/gateway.svg |
| 44 | + - title: Dev Portal |
| 45 | + include_content: prereqs/dev-portal-create-ui |
| 46 | + icon_url: /assets/icons/dev-portal.svg |
| 47 | + - title: Dev Portal APIs |
| 48 | + content: | |
| 49 | + To complete this guide, you'll need an API in Dev Portal. |
| 50 | + 1. In the {{site.konnect_short_name}} sidebar, click **Catalog**. |
| 51 | + 1. Click [**New API**](https://cloud.konghq.com/apis/create). |
| 52 | + 1. In the **API name** field, enter `MyAPI`. |
| 53 | + 1. Click **Create**. |
| 54 | + icon_url: /assets/icons/dev-portal.svg |
| 55 | + entities: |
| 56 | + services: |
| 57 | + - example-service |
| 58 | + routes: |
| 59 | + - example-route |
| 60 | + |
| 61 | +cleanup: |
| 62 | + inline: |
| 63 | + - title: Clean up {{site.konnect_short_name}} environment |
| 64 | + include_content: cleanup/platform/konnect |
| 65 | + icon_url: /assets/icons/gateway.svg |
| 66 | +--- |
| 67 | + |
| 68 | +You can compose API packages from existing APIs in Dev Portal. API packages allow you to: |
| 69 | +* Create distinct APIs for specific use cases or partners based on existing API operations. |
| 70 | +* Link to multiple Gateway Services and/or Routes for developer self-service and application registration. |
| 71 | +* Apply rate limiting policies to an API Package, or per operation. |
| 72 | +* Manage role-based access control to specific developers and teams. |
| 73 | + |
| 74 | +### Associate a control plane |
| 75 | + |
| 76 | +To allow developers to consume your API, you must first link an API Gateway and control plane to your API. |
| 77 | + |
| 78 | +1. In {{site.konnect_short_name}}, click **Catalog**. |
| 79 | +1. Click **MyAPI**. |
| 80 | +1. Click the **Gateway** tab. |
| 81 | +1. Click **Link gateway**. |
| 82 | +1. From the **Control plane** dropdown menu, select "quickstart". |
| 83 | +1. Select **Link to a control plane**. |
| 84 | +1. In the Add the Access Control and Enforcement plugin settings, click **Add plugin**. |
| 85 | +1. Click **Link gateway**. |
| 86 | + |
| 87 | +### Assign operations to API packages |
| 88 | + |
| 89 | +1. In {{site.konnect_short_name}}, click **Catalog**. |
| 90 | +1. Click the **API packages** tab. |
| 91 | +1. Click **Create API package**. |
| 92 | +1. In the **API package name** field, enter `Partner package`. |
| 93 | +1. Enable the Package rate limit and configure your rate limit. |
| 94 | +1. Click **Add operations from APIs** in the API operations settings. |
| 95 | +1. In the Add API operations pane, click your API and click **Add** next to the operations you want to package. |
| 96 | +1. Click **Create API package**. |
| 97 | + |
| 98 | +### Publish packages to Dev Portal |
| 99 | + |
| 100 | +1. In {{site.konnect_short_name}}, navigate to **Dev Portal** > **APIs** in the sidebar. |
| 101 | +1. Click the **API packages** tab. |
| 102 | +1. Click your API package. |
| 103 | +1. Click **Publish API**. |
| 104 | +1. Select your Dev Portal from the **Portal** dropdown menu. |
| 105 | +1. Select an auth strategy from the **Authentication strategy** dropdown menu. |
| 106 | +1. Click **Publish API**. |
| 107 | + |
| 108 | +Your API package will now be published to your Dev Portal. Published API packages appear the same as published APIs in the Dev Portal, and both allow developers to register applications with them. |
0 commit comments