Transcript
Page 2: Create an api with an inline script

Download the API Manager form here http://wso2.com/products/api-manager/

Log in to the API Publisher.

Select the option to design a new API and click Start Creating.

Page 3: Create an api with an inline script

Give the information in the table below. To add resources, click the Add button

Fill the fields with following data.Name : City_NameContext : /locationVersion : 1.0.0

Resources URL pattern {town}Request types GET

Page 4: Create an api with an inline script
Page 5: Create an api with an inline script

Click on {twon}

Click on Next: Implement >

Page 6: Create an api with an inline script

Select Prototype API in Implement phase

Select Inline option.

Expand the GET method.

Page 7: Create an api with an inline script

Copy the following script in the Script area.

mc.setProperty('CONTENT_TYPE', 'application/json');var town = mc.getProperty('uri.var.town');mc.setPayloadJSON('{ "Town" : "'+town+'"}'); Click on Deploy as a Prototype

Page 8: Create an api with an inline script

Select Go to API Store

Login in API Store as admin

Page 9: Create an api with an inline script

Select Prototyped API

Then select your API (City_Name)

Page 10: Create an api with an inline script

Select API Console optionExpand GET methodType the City Name (Any)Click on Try it out button.

Page 11: Create an api with an inline script

This is the Final Response of your API


Top Related