Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: https://github.com/wso2/product-apim/issues/2189

...

This tutorial uses the PhoneVerification API, which is created in section Create and Publish an API

Installing the WSO2 API Manager plugin in Ready! API

...

  1. Run the WSO2 API Manager server.
  2. Run Ready! API if it's not already open.

    Tip

    If you are using a self-signed certificate with WSO2 API Manager, you need to explicitly configure Ready! API to trust this certificate. Click File > Preferences and then select the Internal Browser tab. Select the Trust the self-signed certificate check box and click OK.

  3. Start by creating a new project in Ready! API. Click File > New Project.
  4. In the Description File tab, select the Import from WSO2 API Manager option and click Import.
  5. On the dialog box that appears, enter the information of the API Store from which API information needs to be extracted and click OK

    Tip

    It is possible to import APIs from tenant stores as well.

    Project NameAPI Manager Project
    API Store URLhttps://localhost:9443/store/
    API Store User Nameadmin
    API Store Passwordadmin
    API Manager Version2.0.0

  6. Select one or more APIs from the list of APIs available in the API Store and click OK.
    Your project is created and the required APIs are imported to Ready! API.
  7. Select an API (e.g. PhoneVerification) and expand the API to see all the HTTP verbs associated with it. Select the require HTTP verb (e.g. GET) to test the API.
    Any query parameters that were added when creating the API in the API Manager appear here. You can also add your own resource path or query parameters to test the API. 
  8. To add your own parameters, click the Parameters field and then click the Plus icon.
  9. Enter the required information for the API (e.g. 18006785432 as the phone number).
  10. Once all the required information is added for the API, you need to add the API OAuth 2.0 token to invoke the API. Click the Auth tab at the bottom of the screen.

    You can either get a test access token from the API Store or use the inbuilt OAuth 2.0 access token generation option. In this example, the inbuilt token generation option is used.

    The inbuilt OAuth 2.0 access token generation option allows an access token to be generated with different grant types, which can be used to test the key generation process of WSO2 API Manager without requiring an application to perform the OAuth 2.0 key generation. This option can also be used in cases where you want to test access to different HTTP verbs and resource paths using different types of scopes and API keys.

  11. In the Auth tab, click Get Access Token.
  12. On the dialog box that appears, enter the following information.


    OAuth 2 Flow - You can choose from different grant types to generate your token. In this example, we have used the Client Credentials Grant type.
    Client Identification and  Client Secret - Get these values from the API Store. Browse to the application that the API being tested is subscribed to (e.g. DefaultApplication) and copy the values from the Production Keys tab.
    Access Token URI - Provide the URL of the access token endpoint of the API Manager. By default, this URL is https://localhost:9443/oauth2/token. If you are using a componentized API manager deployment, the URI should point to the Key Manager component of the deployment. 
    Scope - Define the scope under which a token should be generated. If you have not defined any scope restrictions when creating the API you can leave this blank.
  13. Once done, click Get Access Token.
  14. The access token is retrieved from the server.
  15. Now you can invoke the API by sending the request. The response is displayed as shown below. If you encounter an error, make sure that the values given for the endpoint, resource and parameters are correct.

...