6/19/2023 0 Comments Wunderground developer api keyNow that we know the flow it is time to deploy our apex class. Our flow should follow these steps that you can see on this screenshot taken from SFDC documentation:Įxecution Flow of an Asynchronous Callout Redmond, WA, United States 10-Day Weather Forecast - The Weather Channel Weather. Right now we should have our wunderground API key and the Remote Site should be registered and active. Ok, now we have registered our site in our SFDC org will allow us to make callouts to that external site! Also consider the “Named Credentials” as an option for you callouts. If you want to know more about Remote Site Settings check this page. On the remote site name enter whatever feels the best for you, the other options need to be equals to those in the screenshot bellow: Now, all we need to do is to click on New Remote Site. Just go to Setup –> Administer –> Security Controls –> Remote Site Settings. For this, we need to set up a Remote Site. On wunderground’s site, you can find plenty of documentation on how to use their API but we only need to concentrate on one Service URL, this one:īefore we look into that we need to prepare our org to allow us to execute callouts to wunderground. Eclipse, MavensMate or any developer environment that you use for coding apex.įirst, navigate to and get your API key. How do you get an API key? You need to register and apply for a developer API key, it is easy and a fast process.Īfter registering and requesting an API key you will receive an email with your API key that we will be needing to call their API through HTPP.ģ. Let’s take a look at what it is that we need in order to successfully accomplish this tutorial. We are going to use “ Continuation Class” for this example All this information will be retrieved in JSON and will be displayed in our Visualforce page. We are going to add an option to get the country and/or a city from that country to narrow the response. We are going to receive their weather conditions as well. Let’s have a bit of fun and let’s build a Visualforce page that is going to call an API via HTTP and to get in return the latitude and longitude of any country plus their cities. Get World Countries and Cities Weather with their Geolocations (API -JSON).
0 Comments
Leave a Reply. |