yahoo new weather api url not working?

Hello team,

Please help me to create new yahoo weather API and help to Create a proxy to find sunset time for a given city

The city name should be passed in request url. (Ex: http://myproxyurl.com/sunset/city/Bangalore)

0 1 158
1 REPLY 1

@pratheek hipparagi,

Please refer to the documentation on Create your first API proxy. This will help you to create a simple API Proxy. While creating the Proxy, use your API that gives the sunset time for a given city in the "Existing API" text field instead of "http://mocktarget.apigee.net" as shown in the documentation.

For your usecase, you could do this:

1. Set the Proxy name as "sunset"

2. Set the Proxy Basepath as "/"

3. If your API is http://myapi.com/sunset/city/<cityname>; where cityname can be dynamic, just set the "Existing API" as http://myapi.com/

After you deploy the API Proxy, you can make the API call as

curl -v "http://<org_name>-<environment>.apigee.net/sunset/city/Bangalore"

The path suffix sunset/city/Bangalore gets added to your target URL.

Since we have choosen the Basepath as "/", it will be better to have conditional flow in your Proxy so that you don't allow all the paths to this proxy that don't have "/sunset/city".

You can read more about Conditional flows in the following links:

Flow variables and conditions

Controlling how a proxy executes with flows