Subscribe to an API¶
You have to subscribe to a published API before using it in your applications. The subscription process fulfills the authentication process and provides you with access tokens that you can use to invoke an API.
The examples here use the PizzaShackAPI
REST API, which is created and published to Developer Portal in WSO2 API Manager.
The following are the two methods available in the Developer Portal to subscribe an API to an application.
-
Subscribe to an existing application
You can subscribe to a current API by selecting an existing application.
-
Subscribe to an API using Key Generation Wizard
You can use the SUBSCRIPTION & KEY GENERATION WIZARD option to start the subscription process from scratch. It guides you through the process of creating and configuring an application, generating application keys and access tokens, and finally navigates you to the try out page.
Subscribe to an API using Key Generation Wizard¶
-
Sign in to the WSO2 API Developer Portal (
https://<hostname>:<port>/devportal
) and click on the API (e.g.,PizzaShackAPI
) to go to the API overview. -
Click SUBSCRIPTION & KEY GENERATION WIZARD to start the key generation wizard.
-
Enter the application details in the Create application process and click Next to continue.
-
Subscribe the API to the application that you created in the above step by selecting the preferred throttling policy. Thereafter, click Next to go to the next step.
-
Generate application keys (Production or sandbox) by clicking on the Next button.
The application keys are generated in this step.
-
Select the access token validity period and scopes to generate an access token to invoke the API, then click Next to continue.
-
Copy the generated access token.
-
Click Finish to complete the wizard or click Test to navigate to the API Console so that you can invoke and try out the API.
Subscribe to an existing application¶
If you already have an existing application, follow the instructions below to subscribe to the API using that application.
-
Sign in to the Developer Portal (
https://<hostname>:<port>/devportal
) and click on the API (e.g.,PizzaShackAPI
) to go to the API overview. -
Click SUBSCRIBE TO AN APPLICATION.
-
Select the application, the throttling policy, and click Subscribe.
You can see the subscriptions list in the Subscriptions section.
Update the subscription tier¶
-
Sign in to the WSO2 API Developer Portal (
https://<hostname>:<port>/devportal
). Click on Applications and select the relevant application. -
Click Subscriptions to list the subscriptions of the application.
-
Click the EDIT icon of the subscription whose tier needs to be changed, to open the subscription update popup.
-
Select the throttling tier that needs to be updated and click Update. This will update the existing subscription with the newly selected throttling tier.
Follow the steps mentioned in Adding an API Subscription Update Workflow if you need to configure an approval process to update the subscription tier.
Unsubscribe from an API¶
Follow the instructions below to delete the API subscription:
-
Sign in to the WSO2 API Developer Portal (
https://<hostname>:<port>/devportal
) and click on the API (e.g.,PizzaShackAPI
) for which you need to delete the application subscription. -
Click Subscriptions.
-
Select the subscription that you need to delete and click UNSUBSCRIBE.