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

Versions Compared

Key

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

...

This sample invokes twitter API and display results in a web app.

Prerequisites

Need to access the Up and running App Factory (https://appfactorypreview.wso2.com. We need to publish an API first in API Manager.  You can create a API that gives Washington whether details in sandbox and London whether details in the production environment. /appmgt) 

Executing the Sample

 1. Create an application in AppFactory. Lets call it Customer Portal - cportal application. When you create an application in App Factory it will be automatically created in API-M.

...

  • Click on cportal application in Home page.
  • Click on 'Configure Resources' menu item.
  • Go under 'APIs' section and click 'Subscribe' button.
  • Go under 'Subscribe to an API' section and click 'Add Api' button.
  • You will be redirected to API Manager Homepage (https://apimanager.appfactorypreview.wso2.com/store/).
  • Click on 'twitter - 1.0.0' application.

    Image Added
  • Select cportal from 'Applications' drop down and click 'Subscribe' button. You will get the 'Subscription Successful' pop-up.

3. Generate keys by clicking on the create dependencies.

  •  Go under 'Subscribe to an API' section and click 'Add Api' button.
  •  Go under 'Saved Keys' section and click 'Generate Keys' button and keys will be generated for sandbox and production separately.

4.  Write your application to get keys by calling the CarbonContext and Registry APIs. The correct sandbox and production keys will be used depending on where the application is deployed. Here is the code to do that. Take the samples and commit it to your application location.

...