UniStream REST API example
Ofir Levi
Aug-24th, 2020 13:34

REST API – Example Get Weather from AccuWeather

1. Go to https://developer.accuweather.com/ and create new user

2. In upper menus select MY APPS and add new App.

3. After Creating App – you will get API Key:

4. In upper menus select API REFERENCE

5.     In this example we will get daily weather – let's select "Forcast API"

6.     Now select "1 day of daily forecasts"

7.     Here we can see the resource URL:

8. The server name is " http://dataservice.accuweather.com"

In UniLogic after adding REST API Server – under URL we will add the server name.


9.  Then we will click on Server1 to add the end point resource.

The end point Resource is in our case is  "/forecasts/v1/daily/1day/1234" (Where 1234 is the location key)

In our case we will use the city London which its location key is 328328

10.     Now click on Request1 to add the query and response parameters.

11.     Let's add new Query parameter.

12. As we can see in API the query parameter name is apikey and its value and the apikey we got when creating this account.

13. Enter these parameters:

14.     The next step is to fill the response parameters.

We can first run the query in AccuWeather website and see the response.

Here is the request:

Here is the response:

In this example we wish to get the minimum and maximum temperature.

Now according to the response we need to configure the response parameters.

As you can see there are different brackets where { }is starting/ending of struct and [ ] is starting/ending of an array.

In order to view the structure of the response in better way you can use the website http://jsonviewer.stack.hu/ . (You can paste the response under text and then view it in JSON:

In our case we wish to take for example the minimum temperature - as you can see the response starts with { that means the response has one struct with members (members can be structs, arrays etc..)

In our case the struct has 1 struct "Headline" and 1 array "DailyForecasts".

(BTW if the response will start with [ usually it means we get array of structs.)

DailyForecasts array has only one struct member in index 0.

The members of this struct are "Date", "Epoch Date", "Temperature", "Day" etc..

For example if we wish to get the minimum temperature the path will be as follows:

DailyForcast[0]/Temperature/Minimum/Value.

This will be configured as follows:

We can add another response parameter and do the same for maximum temperature:

Now we can add a ladder element to call the REST request:







Was this article helpful?
3 out of 3 found this helpful