{"id":110740,"date":"2016-07-15T10:57:02","date_gmt":"2016-07-15T17:57:02","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/"},"modified":"2016-07-15T10:57:02","modified_gmt":"2016-07-15T17:57:02","slug":"http-card-tutorial","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/","title":{"rendered":"Using the HTTP action to make requests with Microsoft Flow"},"content":{"rendered":"
Last week I blogged about how you can use a simple custom API<\/a> to send yourself weather updates periodically. Custom APIs are very useful when you want to reuse custom actions across many flows. If your scenario requires using the action just in one flow, writing a custom API for that one action could be a bit of an overkill. In this blog post, we are going to look at using the HTTP card and how to use\u00a0it within a\u00a0flow. The response body like this –<\/p>\n Specifically, we are interested in the property that’s highlighted, if the value of the “main” <\/em>property contains the word Rain<\/samp>, then we want the flow to send a Push notification, if not – do nothing.<\/p>\n To reference the property we will need to use the advanced mode on the condition card, and set it up as follows :<\/p>\n
\nAgain for this blog post \u2013 I am going to use the weather example, this time though from openweathermap.org<\/a> to get the weather information for Seattle, US. Then I am going to check whether it is going to rain or not using the condition <\/em><\/strong>card, and send myself a push notification only if it\u2019s going to rain.
\nLooking at the openweathermap APIs you can see that we need to make a GET <\/strong>request with the URI (as shown) to get the weather for Seattle, US.<\/p>\n<\/p>\n
{
\n\u00a0 \"message\": \"accurate\",
\n\u00a0 \"cod\": \"200\",
\n\u00a0 \"count\": 1,
\n\u00a0 \"list\": [
\n\u00a0\u00a0\u00a0 {
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"id\": 5809844,
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"name\": \"Seattle\",
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"coord\": {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"lon\": -122.332069,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"lat\": 47.606209
\n\u00a0\u00a0\u00a0\u00a0\u00a0 },
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"main\": {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"temp\": 294.49,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"pressure\": 1021,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"humidity\": 40,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"temp_min\": 292.04,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"temp_max\": 296.15
\n\u00a0\u00a0\u00a0\u00a0\u00a0 },
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"dt\": 1468619160,
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"wind\": {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"speed\": 3.1,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"deg\": 230
\n\u00a0\u00a0\u00a0\u00a0\u00a0 },
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"sys\": {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"country\": \"US\"
\n\u00a0\u00a0\u00a0\u00a0\u00a0 },
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"clouds\": {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"all\": 75
\n\u00a0\u00a0\u00a0\u00a0\u00a0 },
\n\u00a0\u00a0\u00a0\u00a0\u00a0 \"weather\": [
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"id\": 803,
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"main\": \"Clouds\",
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"description\": \"broken clouds\",
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"icon\": \"04d\"
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }
\n\u00a0\u00a0\u00a0\u00a0\u00a0 ]
\n\u00a0\u00a0\u00a0 }
\n\u00a0 ]
\n}<\/code><\/div>\n