<?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 Re: How do i set parameters of rest api in InvokeHTTP of NiFi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-do-i-set-parameters-of-rest-api-in-InvokeHTTP-of-NiFi/m-p/351890#M236395</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure how you get the URL but if its hard coded in the InvokeHttp Remote URL property , then you can use expression language to set up your parameters as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${literal('https://api.aa/reports/api/order_report/?format=json&amp;amp;dateFrom=#DATEFROM&amp;amp;dateTo=#DATETO'):
  replace('#DATEFROM',${now():format('yyyy-MM-dd')}):
  replace('#DATETO',${now():toNumber():minus(432000000):format("yyyy-MM-dd")})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice:&lt;/P&gt;&lt;P&gt;- you can set the date format as desired, in my case I assumed that its in yyyy-MM-dd format.&lt;/P&gt;&lt;P&gt;- To subtract 5 days from the current date you have to convert the date to number , then subtract 5 days in milliseconds (1day = 86,400,000 mls ).&lt;/P&gt;&lt;P&gt;Hope that helps, if it does please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 18:20:21 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2022-09-09T18:20:21Z</dc:date>
    <item>
      <title>How do i set parameters of rest api in InvokeHTTP of NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-i-set-parameters-of-rest-api-in-InvokeHTTP-of-NiFi/m-p/351852#M236391</link>
      <description>&lt;P&gt;I want to filter my rest api with date range. The rest api has dateFrom and dateTo parameters. I want to set dateFrom to 5 days ago and dateTo to now. How do i set the parameters in NiFi ?&lt;/P&gt;&lt;P&gt;My api looks like the below URL:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://api.aa/reports/api/order_report/?format=json&amp;amp;dateFrom=&amp;amp;dateTo=" rel="nofollow noreferrer" target="_blank"&gt;https://api.aa/reports/api/order_report/?format=json&amp;amp;dateFrom=&amp;amp;dateTo=&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 09 Sep 2022 10:38:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-i-set-parameters-of-rest-api-in-InvokeHTTP-of-NiFi/m-p/351852#M236391</guid>
      <dc:creator>wetland</dc:creator>
      <dc:date>2022-09-09T10:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do i set parameters of rest api in InvokeHTTP of NiFi?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-do-i-set-parameters-of-rest-api-in-InvokeHTTP-of-NiFi/m-p/351890#M236395</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure how you get the URL but if its hard coded in the InvokeHttp Remote URL property , then you can use expression language to set up your parameters as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${literal('https://api.aa/reports/api/order_report/?format=json&amp;amp;dateFrom=#DATEFROM&amp;amp;dateTo=#DATETO'):
  replace('#DATEFROM',${now():format('yyyy-MM-dd')}):
  replace('#DATETO',${now():toNumber():minus(432000000):format("yyyy-MM-dd")})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice:&lt;/P&gt;&lt;P&gt;- you can set the date format as desired, in my case I assumed that its in yyyy-MM-dd format.&lt;/P&gt;&lt;P&gt;- To subtract 5 days from the current date you have to convert the date to number , then subtract 5 days in milliseconds (1day = 86,400,000 mls ).&lt;/P&gt;&lt;P&gt;Hope that helps, if it does please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 18:20:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-do-i-set-parameters-of-rest-api-in-InvokeHTTP-of-NiFi/m-p/351890#M236395</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-09-09T18:20:21Z</dc:date>
    </item>
  </channel>
</rss>

