Versions Compared

Key

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

WSO2 API Manager is a complete solution for publishing APIs, creating and managing a developer community and for routing API traffic in a scalable manner. It leverages the integration, security and governance components from the WSO2 Enterprise Service Bus, WSO2 Identity Server, and WSO2 Governance Registry. In addition, as it is powered by the WSO2 Business Activity Monitor (BAM), the WSO2 API Manager is ready for massively scalable deployments immediately.

...

  1. Open the API Publisher (https://<hostname>:9443/publisher) and log in as apicreator if you haven't done so already.
  2. Click the PhoneVerification API to open it and then click the Edit link right next to the API's name. This opens the API in its edit mode.
  3. Click the Edit Swagger Definition button.
  4. When the Swagger definition of the API opens, navigate to the GET method, add two parameters to it as PhoneNumber and LicenseKey and document their descriptions. The code is given below:

    Anchor
    thisStep
    thisStep

    Code Block
    parameters:
       - description: Request Body
         name: body      allowMultiple: false
         required: true
         type: string
         paramType: body
       - description: Give the phone number to be validated
         name: PhoneNumber
         type: string
         required: "True"
         paramType: query
       - description: "Give the license key. If you don't have any, enter 0"
         name: LicenseKey
         type: string
         required: "True"
         paramType: query
  5. Click Save once the changes are done. In a later section, we will see how these parameters appear to subscribers in the API Console of the API Store.

...

  1. Log in to the API Publisher as apicreator if you are not logged in already.
  2. Click on the PhoneVerification API and then the Copy button that appears in its Overview tab.
  3. Give a new version number (e.g., 2.0.0) and click Done.

    Tip

    Tip: The Default Version option means that you make this version the default in a group of different versions of the API. A default API can be invoked without specifying the version number in the URL. For example, if you mark http://host:port/youtube/2.0 as the default version when the API has 1.0 and 3.0 versions as well, requests made to http://host:port/youtube/ get automatically routed to version 2.0. 

    If you mark any version of an API as the default, you get two API URLs in its Overview page in the API Store. One URL is with the version and the other is without. You can invoke a default version using both URLs.

    If you mark an unpublished API as the default, the previous default, published API will still be used as the default until the new default API is published (or prototyped).

...

  1. Click the APIs menu in the API Store and then click on the API that you want to invoke. When the API opens, go to its API Console tab.

  2. Expand the GET method of the resource CheckPhoneNumber. Note the parameters that you added in this step now appearing with their descriptions in the console.

  3. Give sample values to the PhoneNumber and LicenseKey and click Try it Out to invoke the API. 

    Tip

    Tip: If you cannot invoke the API's HTTPS endpoint (causes the SSLPeerUnverified exception), it could be because the security certificate issued by the server is not trusted by your browser. To resolve this issue, access the HTTPS endpoint directly from your browser and accept the security certificate.

    Image RemovedImage Added

  4. Note the response for the API invocation. As we used a valid phone number in this example, the response is valid.
    Image Added

 You have invoked an API using the API Console.

...