<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question NiFi - Extract attributes from JSON as argument in InvokeHTTP Processor in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Extract-attributes-from-JSON-as-argument-in-InvokeHTTP/m-p/226452#M72756</link>
    <description>&lt;P&gt;I'm trying to load weather data as http API request. Therefore I need to extract the geo information from an incoming JSON flowfile. This is my JSON data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;{
  "id" : 590575476,
  "sampling_rate" : null,
  "timestamp" : "2017-12-19 13:23:20",
  "location" : {
    "id" : 1311,
    "latitude" : "47.967",
    "longitude" : "7.959",
    "country" : "DE"
  },
  "sensor" : {
    "id" : 2602,
    "pin" : "1",
    "sensor_type" : {
      "id" : 14,
      "name" : "SDS011",
      "manufacturer" : "Nova Fitness"
    }
  },
  "sensordatavalues" : [ {
    "id" : 1291686812,
    "value" : "25.87",
    "value_type" : "P1"
  }, {
    "id" : 1291686813,
    "value" : "15.63",
    "value_type" : "P2"
  } ]
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to access latitude and longitude as attributes for the URL in the InvokeHTTP processor?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey"&gt;http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey&lt;/A&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Dec 2017 21:42:21 GMT</pubDate>
    <dc:creator>lukas_mueller02</dc:creator>
    <dc:date>2017-12-19T21:42:21Z</dc:date>
    <item>
      <title>NiFi - Extract attributes from JSON as argument in InvokeHTTP Processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Extract-attributes-from-JSON-as-argument-in-InvokeHTTP/m-p/226452#M72756</link>
      <description>&lt;P&gt;I'm trying to load weather data as http API request. Therefore I need to extract the geo information from an incoming JSON flowfile. This is my JSON data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;{
  "id" : 590575476,
  "sampling_rate" : null,
  "timestamp" : "2017-12-19 13:23:20",
  "location" : {
    "id" : 1311,
    "latitude" : "47.967",
    "longitude" : "7.959",
    "country" : "DE"
  },
  "sensor" : {
    "id" : 2602,
    "pin" : "1",
    "sensor_type" : {
      "id" : 14,
      "name" : "SDS011",
      "manufacturer" : "Nova Fitness"
    }
  },
  "sensordatavalues" : [ {
    "id" : 1291686812,
    "value" : "25.87",
    "value_type" : "P1"
  }, {
    "id" : 1291686813,
    "value" : "15.63",
    "value_type" : "P2"
  } ]
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to access latitude and longitude as attributes for the URL in the InvokeHTTP processor?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey"&gt;http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey&lt;/A&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 21:42:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Extract-attributes-from-JSON-as-argument-in-InvokeHTTP/m-p/226452#M72756</guid>
      <dc:creator>lukas_mueller02</dc:creator>
      <dc:date>2017-12-19T21:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Extract attributes from JSON as argument in InvokeHTTP Processor</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Extract-attributes-from-JSON-as-argument-in-InvokeHTTP/m-p/226453#M72757</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/29248/lukasmueller0289.html" nodeid="29248" target="_blank"&gt;@Lukas Müller&lt;/A&gt;&lt;P&gt;Use EvaluateJSON path processor with below configs:-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45480-evaljson.png" style="width: 1946px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15357i9B5B499FE88678AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45480-evaljson.png" alt="45480-evaljson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then we are adding longitude and latitude attributes to the flowfile as&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="45481-output.png" style="width: 635px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/15358iAE826109EF555CB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="45481-output.png" alt="45481-output.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;then use &lt;STRONG&gt;url in invoke http processor as&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey" target="_blank" rel="nofollow noopener noreferrer"&gt;http://api.openweathermap.org/data/2.5/weather?lat=${location.latitude}&amp;amp;lon=${location.longitude}&amp;amp;APPID=myapikey&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button&lt;/STRONG&gt; below to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 01:27:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Extract-attributes-from-JSON-as-argument-in-InvokeHTTP/m-p/226453#M72757</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T01:27:21Z</dc:date>
    </item>
  </channel>
</rss>

