Skip to content

Quick Start Guide

New to WSO2 API Manager? No worries; we'll guide you through the basics!

In this step-by-step guide, you’ll learn how to create, publish, and invoke an API using the Publisher Portal and Developer Portal.

Before you begin...

Choose a deployment option to start WSO2 API Manager.

Here's how you can download and run WSO2 API Manager locally:

  1. Install Java SE Development Kit (JDK) version 21 and set the JAVA_HOME environment variable.

    Tip

    For more information on setting the JAVA_HOME environment variable for different operating systems, see Setup and Install

  2. Download WSO2 API-Manager.

  3. Extract the downloaded zip file.

  4. Navigate to the <API-M_HOME>/bin folder from your command line.

  5. To start WSO2 API Manager, execute the relevant command:

    sh api-manager.sh
    
    api-manager.bat --run
    

Here's how you can run WSO2 API Manager using Docker:

  1. Install Docker if you haven't done so already.
  2. Pull and start WSO2 API Manager by executing the following command:

    docker run -it -p 9443:9443 -p 8243:8243 wso2/wso2am:4.4.0
    

    Note

    • The docker run command will start WSO2 API Manager and expose the ports 9443 and 8243.

What you'll build

In this sample scenario, you'll implement the full lifecycle of an API using WSO2 API Manager.

Here are the steps that we are going to follow:

Let's get started...

Step 1: Create, Deploy and Publish an API

Follow the instructions below to create, deploy and publish an API via the Publisher Portal of WSO2 API-M.

  1. Navigate to the Publisher Portal.

    https://localhost:9443/publisher

  2. Sign in with admin/admin as the credentials.

    Publisher portal home page

  3. Next, let's create a mock REST service by navigating to Mocky.io. You can provide the following configuration in order to create a mock service.

    Field Value
    HTTP Status 200 - OK
    Response Content Type application/json
    Charset UTF-8
    HTTP Response Body {"hello": "world"}

    Finally click Generate My HTTP Response to save and generate the mock service url.

  4. Select REST API from the home screen and then click Start From Scratch.

    Design a new REST API

  5. Enter the API details.

    Name HelloWorld
    Context /hello
    Version 1.0.0
    Endpoint https://run.mocky.io/v3/e42a76f0-95f3-4759-b658-dcc2b0c8bacd

    Create an API

  6. Click Create & Publish.

    This will publish your first API on the Developer Portal as well as deploy it on the API Gateway. You now have an OAuth 2.0 secured REST API that is ready to be consumed.

Step 2: Subscribe to the API

Follow the instructions below to subscribe to the API via the Developer Portal of WSO2 API-M.

  1. Navigate to the Developer Portal.

    https://localhost:9443/devportal

    The published HelloWorld API is listed in the Developer Portal as shown below.

    Developer Portal home page

  2. Click Sign-In and enter admin/admin as your credentials to sign in to the Developer Portal.

  3. Once you click on the HelloWorld API, you will be redirected to the API overview page. Then, go ahead and click on the TRY OUT button.

    API try out

    And with that, we have subscribed to the API using the DefaultApplication.

Step 3: Invoke the API

Follow the instructions below to invoke the created API.

  1. Click on Try OutAPI Console from the left menu. Then, click on GET TEST KEY to generate a test access token.

    Note

    If this is the first time you are using the API console from your browser, open a new tab and navigate to the https://localhost:8243/ URL.

    This will prompt your browser to accept the certificate used by the API Gateway. This is required because by default the API Gateway uses a self-signed certificate that is not trusted by web browsers.

    Since a trusted certificate is used when running in production, you won't have to do this step when running in production.

    Test API

  2. Click on the GET resource of the API to expand the resource and Click Try It Out.

    GET resource

  3. Click Execute.

    GET resource

    You should see the {"hello" : "world"} response from the API.

    Successful response

Congratulations! With that, you've created, deployed, and published your first API. Next, you subscribed to it and put it to the test. Your journey with WSO2 API Manager has officially begun!