Defining a REST endpoint

We must define every REST endpoint using the REST Message module. To define the REST endpoint, open Studio and in the Create Application File wizard, select Outbound Integrations | REST Message, as shown in the following screenshot, and click Create:

The REST Message new record form, as shown in the following screenshot, will open in Studio:

Fill in the form with the following values:

  • Name: Yahoo Weather
  • Accessible from: All application scopes
  • Endpoint: https://query.yahooapis.com/v1/public/yql

Click on the Submit button to create the endpoint definition. Now scroll down to the HTTP Methods related list, as shown in the following screenshot:

The system will automatically create the Default GET method entry for us. Click on the info icon next to the Default GET method and edit the form as shown in the following screenshot:

Make sure to change the endpoint URL to https://query.yahooapis.com/v1/public/yql?q=${yql}&format=json&callback.

${city} is a placeholder for the variable of the same name city. We will pass a value to the variable from the workflow to fetch the weather conditions of the city we are interested in.

YQL is short for Yahoo Query Language. You can learn more about Yahoo's YQL and Yahoo Weather API by visiting the API home page at https://developer.yahoo.com/weather/.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.34.0