This documentation is for WSO2 API Manager 1.10.0 View documentation for the latest release.
Page Comparison - Subscribe to an API (v.2 vs v.3) - API Manager 1.10.0 - WSO2 Documentation

Versions Compared


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


  1. Log in to the API Store (https://<hostname>:9443/store) and click on an API (e.g., PhoneVerification 1.0.0) to open it.


    Tip: In a multi-tenanted API Manager setup, you can access any tenant's store using the URL http://<hostname>/Store?tenant=<tenant_name>.

  2. Note the subscription options on the API's Overview page.

  3. Click the My Applications menu and create a new application.


    Tip: Instead of creating a new application, you can also use the default application.

  4. Go back to the API's subscription options and select the application you just created, a tier and click Subscribe.

  5. Click the Go to My Subscriptions button when prompted. The subscriptions page opens.

  6. Select the application from the drop-down list and click Generate Keys to create an application access token. You can use this token to invoke all APIs that you subscribe to using the same application.


    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.


    If you are using the WSO2 Identity Server 5.0.0 (with service pack 1) as the Key Manager for your API Manager deployment, generating keys will result in creation of a Service Provider on the Identity Server.

  7. Install cURL if it is not there in your environment. Note that cURL comes by default in some operating systems. You can also use any other REST client.

  8. Open the command line and execute the following cURL command:

    Code Block
    curl -k -H "Authorization: Bearer <access token>" -v '<API URL>'

    Be sure to replace the placeholders as follows:

    Here's an example:

    Code Block
    curl -k -H "Authorization :Bearer 2604c07a62b13a0baa660b1f3fe36d22" 'https://localhost:8243/phoneverify/1.0.0/CheckPhoneNumber?PhoneNumber=18006785432&LicenseKey=0'
  9. Note the result that appears on the command line.

  10. Similarly, invoke the POST method using the following cURL command:

    Code Block
    curl -k -H "Authorization :Bearer 2604c07a62b13a0baa660b1f3fe36d22" --data "PhoneNumber=18006785432&LicenseKey=0" https://localhost:8243/phoneverify/1.0.0/CheckPhoneNumber