{"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":"

Using the HTTP card in Microsoft Flow and referencing the output parmeters in conditions<\/h1>\n

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.
\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

\"FTW_6\"<\/p>\n

The response body like this –<\/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

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

@contains(body('Http')['list'][0]['weather'][0]['main']}', 'Rain')<\/code><\/div>\n

Learn more about flow\u00a0expressions here : https:\/\/msdn.microsoft.com\/library\/azure\/mt643789.aspx<\/a><\/p>\n

\u00a0<\/p>\n

\"FTW_7\"<\/p>\n

\u00a0<\/p>\n

This flow, will now send me a push notification whenever it detects rain. You can play around with how often you’d like to receive these notifications or setup various other conditions. The HTTP card is a very powerful tool to quickly get a custom action into Flow.<\/p>\n

NOTE<\/strong><\/u>: We have a limitation today,\u00a0where expressions can only be used in the advanced mode on the\u00a0condition <\/em><\/strong>card. The HTTP + Swagger action can be used in scenarios where you want to use tokens from the response body, much similar to Custom APIs, which\u00a0I will cover in a future post.<\/p>\n

\u00a0<\/p>\n

\u00a0<\/p>\n

\u00a0<\/p>\n

\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"

Learn how to use the HTTP card in your flow. This post shows you how to use the HTTP card to get weather information and use the condition card to send a push notification only if it rains. <\/p>\n","protected":false},"author":131,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2590,2836],"power-automate-tag":[],"coauthors":[2134],"class_list":["post-110740","power-automate","type-power-automate","status-publish","hentry","power-automate-category-flow-of-the-week","power-automate-category-walkthroughs"],"yoast_head":"\nUsing the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the HTTP card in your flow. This post shows you how to use the HTTP card to get weather information and use the condition card to send a push notification only if it rains.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Power Platform Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 min read\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"Sunay Vaishnav\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/\",\"name\":\"Using the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.png\",\"datePublished\":\"2016-07-15T17:57:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.webp\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.webp\",\"width\":526,\"height\":530,\"caption\":\"graphical user interface\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Power Automate\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using the HTTP action to make requests with Microsoft Flow\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"name\":\"Microsoft Power Platform Blog\",\"description\":\"Innovate with Business Apps\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization\",\"name\":\"Microsoft Power Platform Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png\",\"width\":194,\"height\":145,\"caption\":\"Microsoft Power Platform Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Using the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog","og_description":"Learn how to use the HTTP card in your flow. This post shows you how to use the HTTP card to get weather information and use the condition card to send a push notification only if it rains.","og_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/","og_site_name":"Microsoft Power Platform Blog","og_image":[{"url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 min read","Written by":"Sunay Vaishnav"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/","name":"Using the HTTP action to make requests with Microsoft Flow - Microsoft Power Platform Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.png","datePublished":"2016-07-15T17:57:02+00:00","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#primaryimage","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.webp","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2024\/06\/FTW_6.webp","width":526,"height":530,"caption":"graphical user interface"},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/http-card-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/"},{"@type":"ListItem","position":2,"name":"Power Automate","item":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/"},{"@type":"ListItem","position":3,"name":"Using the HTTP action to make requests with Microsoft Flow"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","name":"Microsoft Power Platform Blog","description":"Innovate with Business Apps","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#organization","name":"Microsoft Power Platform Blog","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-content\/uploads\/2020\/03\/Microsoft-Logo-e1685482038800.png","width":194,"height":145,"caption":"Microsoft Power Platform Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/#\/schema\/logo\/image\/"}}]}},"msxcm_display_generated_audio":false,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Power Platform Blog","distributor_original_site_url":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/types\/power-automate"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/users\/131"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/comments?post=110740"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate\/110740\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/media?parent=110740"}],"wp:term":[{"taxonomy":"power-automate-category","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-category?post=110740"},{"taxonomy":"power-automate-tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/power-automate-tag?post=110740"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/wp-json\/wp\/v2\/coauthors?post=110740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}