Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

WSO2 API Manager is a complete solution for designing and publishing APIs, creating and managing a developer community, and for securing and routing API traffic in a scalable manner. It leverages proven components from the WSO2 platform to secure, integrate and manage APIs. In addition, it integrates with the WSO2 analytics platform and provides out of the box reports and alerts, giving you instant insights into the APIs behavior.

Tip
titleBefore you begin

Follow the instructions below to run WSO2 API-M.

Localtabgroup
Localtab
titleRun on Docker
  1. Run the command below to pull WSO2 API Manager 2.6.0 Docker image.

    Code Block
    docker pull wso2/wso2am:2.6.0
  2. Start a Docker container using the pulled image.
    Note that this can take a few minutes when run for the first time.

    Code Block
    docker run -it -p 8280:8280 -p 8243:8243 -p 9443:9443 --name api-manager wso2/wso2am:2.6.0
    • Port 8280 and 8243 are used for API calls (HTTP and HTTPS respectively), and port 9443 is used for UI and internal services. For more information, see  Docker Hub - wso2am .
Localtab
titleRun the binary
  1. Download and install JDK (AdoptOpenJDK 8, CorrettoJDK 8, OpenJDK 8, or Oracle JDK 1.8.*). and set the JAVA_HOME environment variable.
    For information on setting the JAVA_HOME  environment variable for different operating systems, see Installing via the ProductInstaller.
  2. Download the latest version of WSO2 API Manager.
  3. Start WSO2 API Manager by going to the <API-M_HOME>/bin directory using the command-line and then executing wso2server.bat (for Windows) or wso2server.sh (for Linux.)

...

  1. Open the API Publisher (https://<hostname>:9443/publisher) and sign in with admin/admin  credentials.
  2. Exit from API creation tutorial by clicking the close icon(X) on top right corner.

  3. Click the Deploy Sample API button. It deploys a sample API called PizzaShackAPI into the API Manager.

    Note

    This Deploy Sample API option is available only when there are no APIs in API Publisher. If you have already created a an API, this option will not be available.

  4. Click PizzaShackAPI to open it. 

  5. Go to the Lifecycle tab and note that the State is PUBLISHED. The API is already published to the API Store.


  6. Sign in to the API Store (https://<hostname>:9443/store) with the  admin/admin  credentials and click on the PizzaShackAPI API.

    Tip
    titleAPI Store Walkthrough

    You can click "API Store walkthrough" to view the interactive tutorial to invoke the API.

  7. Select the default application and an available tier, and click Subscribe. 

  8. When the subscription is successful, click View Subscriptions on the information message that appears. Click the Production Keys tab and click Generate Keys to generate an access token to invoke the API. 


    You have now successfully subscribed to an API. Let's invoke the API using the integrated Swagger-based API Console.

  9. Click the APIs menu again and click the PizzaShackAPI to open it. When the API opens, click its API Console tab.

    Expand the GET method (which retrieves the menu) and click Try it out

    Note the response for the API invocation. It returns the list of menu items.

...

  1. Go to the API Store (https://<hostname>:9443/store) and create an account using the Sign-up link.

    Note

    Users who sign-up through the API Store are assigned the subscriber role by default. Therefore, you do not need to specify the role through the management console to be able to subscibe to an API.

  2. Fill the details in the Sign Up form appears and click Sign Up.

    Note

    Users who registered with the API Store Signup can be view by login to the Management Console (https://localhost:9443/carbon) and accessing Users and Roles > Users > List.

    Image Modified

    Details entered in the sign up will be updated in the default profile related to each user in the management console.


  3. After signing up, sign in to the API Store and click the PhoneVerification 2.0.0 API that you published earlier.

  4. Note that you can now see the subscription options. Select the default application and the Bronze tier. Click Subscribe.


  5. Once the subscription is successful, click View Subscriptions in the information message that appears to review your subscriptions.
  6. Click the Production Keys tab of the application and then click Generate Keys to generate an access token that you use later to invoke the API. If you have already generated keys before, click Re-generate.

    Tip

    Tip : You can set a token validity period in the given text box. By default, it is set to one hour. If you set a minus value (e.g., -1), the token will never expire.

...