This documentation is for WSO2 App Factory 1.0.0. View documentation for the latest release.

Versions Compared


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

The sample is described in the following topics.

Table of Contents


This sample invokes demonstrates how to invoke yahoo weather API and display displays results in a web appWeb application.



  1. Register and log in to WSO2 App Factory


  1. here:


  1. . See instructions in Getting Started.
  2. Log in to API Publisher (


  1. and add API by the name yahoo weather 1.0.0. Provide the following values in Add New API window.



    • Auth Type of API Resource as Application & Application


Image Removed

(Note: You can create your own API by referring Quick Start Guide#CreatinganAPI)

Executing the Sample

 1. Create a web application in AppFactory. Lets call it API-Invoker application. When you create an application in App Factory it will be automatically created in API-M.


    • User

    For more information on creating an API, see APIs.

You now have a sample API created in App Factory. Let's see how to consume this from your Web app.

Executing the sample

  1. Log in to App Factory portal and click Add New Application to create a new application with the following specifications:

    Name: API-Invoker
    Application Type: Web Application
    Repository Type: Git

    For more information on creating applications, see Creating and Viewing Applications.
  2.  Check out the API-Invoker source code with


  1. Git clone command. Its folder structure is as follows:

3. Write your application to get keys by calling the CarbonContext and Registry APIs. The correct sandbox and production keys (consumer key and consumer secret) will be used depending on where the application is deployed.