<?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: GetHTTP making multiple api calls with changing parameter in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199429#M76645</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thank you sir i really appreciate your help, although i am having trouble loading your template, i am getting the following error!?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/67440-templateerror.png"&gt;templateerror.png&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 22:41:02 GMT</pubDate>
    <dc:creator>mcgmark87</dc:creator>
    <dc:date>2018-03-29T22:41:02Z</dc:date>
    <item>
      <title>GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199425#M76641</link>
      <description>&lt;P&gt;Hi i'm needing to make an api call for data pertaining to each day in a calendar year. I don't want to do this manually as it will be a laborious task and i will no doubt make a mistake at some stage. The api request is as follows: &lt;/P&gt;&lt;P&gt;&lt;A href="http://api.wunderground.com/api/dfe2f11fb7108c21/history_20170101/q/CA/EWR.json" target="_blank"&gt;http://api.wunderground.com/api/dfe2f11fb7108c21/history_20170101/q/CA/EWR.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;with the date parameter needing to change for each request. Is there a way to automate this process. &lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 19:11:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199425#M76641</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2018-03-29T19:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199426#M76642</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187" target="_blank"&gt;@Mark McGowan&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Use GenerateFlowFile processor with Invoke Http processor to get date dynamically.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;GenerateflowFile configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64936-generateff.png" style="width: 1414px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17645i975B8E03D3F4060C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64936-generateff.png" alt="64936-generateff.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in this processor add new property as &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;dd&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${now():format("yyyyMMdd")} //Gives today's date and added as flowfile attribute with dd as name&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;InvokeHttp Processor:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64937-invokehttp.png" style="width: 2315px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17646iE5C7D9B2297D81AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64937-invokehttp.png" alt="64937-invokehttp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Change the remote url in Invoke http processor with&lt;/P&gt;&lt;PRE&gt;&lt;A href="http://api.wunderground.com/api/dfe2f11fb7108c21/history_${dd}/q/CA/EWR.json" target="_blank" rel="nofollow noopener noreferrer"&gt;http://api.wunderground.com/api/dfe2f11fb7108c21/history_${dd}/q/CA/EWR.json&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Use Response relationship from invoke http processor and we are using &lt;STRONG&gt;dd attribute value&lt;/STRONG&gt; in the url request, now you don't need to change the url daily.&lt;/P&gt;&lt;P&gt;Schedule the generate flowfile processor to run daily so that invoke http processor will run dynamically.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64938-flow.png" style="width: 1224px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17647iF80D375EBD127D99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64938-flow.png" alt="64938-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:55:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199426#M76642</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199427#M76643</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;P&gt;Thanks for your prompt response.&lt;/P&gt;&lt;P&gt;I can see how that would work if i was making calls for the current day as each day progresses but i need to make the calls with historical dates i.e. start of at 2017/01/01 next call is 2017/01/02 all the way to 2017/12/31.&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 19:48:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199427#M76643</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2018-03-29T19:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199428#M76644</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187" target="_blank"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;Yes, we can do that for this case we need to fork invokehttp processor response
relation to fork 1 response goes for processing, 2 response relation will goes
to RouteOnattribute processor to check is the date is in range or not. If in
range then we are updating the date and again going to invoke http processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Loop:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64945-loop.png" style="width: 2496px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17644i6119CED692F395C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64945-loop.png" alt="64945-loop.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;UpdateAttribute processor configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;dd&lt;/P&gt;&lt;PRE&gt;${dd:isNull():ifElse('20170101','${dd:toDate("yyyyMMdd"):toNumber():plus(100800000):format("yyyyMMdd")}')}&lt;/PRE&gt;&lt;P&gt;Checking dd attribute value if the value is null
then 20170101 for the first run we are going to have this value.&lt;/P&gt;&lt;P&gt;if not null i.e from second run we are adding 100800000
milliseconds(i.e 28 hrs because my server configured with est and we need to
consider day light saving we need to consider).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Invoke Http processor configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Remote URL&lt;/P&gt;&lt;P&gt;&lt;A href="http://api.wunderground.com/api/dfe2f11fb7108c21/history_$%7bdd%7d/q/CA/EWR.json" rel="nofollow noopener noreferrer" target="_blank"&gt;http://api.wunderground.com/api/dfe2f11fb7108c21/history_${dd}/q/CA/EWR.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;this won’t change because we are modifying dd attribute value
in Update Attribute processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;RouteOnAttribute configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this processor we need to add new property&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in
range&lt;/STRONG&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${dd:lt('20171231')}&lt;/PRE&gt;&lt;P&gt;Checking dd attribute value less than 20171231 if the value
is less than then flowfile will goes to &lt;/P&gt;&lt;PRE&gt;1.Update Attribute processor and updating the dd value(+1 day)&lt;BR /&gt;2.then to invoke http processor fork response &lt;BR /&gt;2.1.first-fork goes to Routeonattribute processor&lt;BR /&gt;2.2 second-fork goes for processing&lt;/PRE&gt;&lt;P&gt;i have attached my flow xml, use that for reference and make changes as per your use cases..&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/64946-loop-invokehttp-181963.xml" target="_blank"&gt;loop-invokehttp-181963.xm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:54:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199428#M76644</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199429#M76645</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thank you sir i really appreciate your help, although i am having trouble loading your template, i am getting the following error!?&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/67440-templateerror.png"&gt;templateerror.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 22:41:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199429#M76645</guid>
      <dc:creator>mcgmark87</dc:creator>
      <dc:date>2018-03-29T22:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199430#M76646</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187" target="_blank"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;Try this template once&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/64952-181963-loop-invokehttp.xml" target="_blank"&gt;181963-loop-invokehttp.xml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;if you are still facing issues then i have added all processor configs below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64949-flow.png" style="width: 1249px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17640iAC4464D153A7EFE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64949-flow.png" alt="64949-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Generate flowfile&lt;/STRONG&gt; leave as default and schedule by using cron (or) timer driven and running on primary node.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Update Attribute Configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64950-updateattribute.png" style="width: 1157px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17641i39ACF326BBB1C2A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64950-updateattribute.png" alt="64950-updateattribute.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Add new property&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;dd
&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${dd:isNull():ifElse('20170101','${dd:toDate("yyyyMMdd"):toNumber():plus(100800000):format("yyyyMMdd")}')}&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Invoke http configs:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64951-ihttp.png" style="width: 1053px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17642i5BBD5B3BE9C09999/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64951-ihttp.png" alt="64951-ihttp.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;STRONG&gt;Remote URL
&lt;/STRONG&gt;&lt;PRE&gt;&lt;A href="http://api.wunderground.com/api/dfe2f11fb7108c21/history_${dd}/q/CA/EWR.json" target="_blank" rel="nofollow noopener noreferrer"&gt;http://api.wunderground.com/api/dfe2f11fb7108c21/history_${dd}/q/CA/EWR.json&lt;/A&gt;&lt;/PRE&gt;&lt;P&gt;Handle connection timeout issues and another relationships in invoke http processor(no retry..etc)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;RouteOnAttribute:-&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="64953-roa.png" style="width: 783px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17643iFC86EFBC15704ADD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="64953-roa.png" alt="64953-roa.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Add new property as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in range
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;${dd:lt('20171231')}&lt;/PRE&gt;&lt;P&gt;Connect all the relations as shown in the flow screenshot.&lt;/P&gt;&lt;P&gt;Let us know if you are having issues..!!&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:54:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199430#M76646</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: GetHTTP making multiple api calls with changing parameter</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199431#M76647</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/70187/mcgmark87.html" nodeid="70187"&gt;@Mark McGowan&lt;/A&gt;&lt;P&gt;Does the answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer&lt;/STRONG&gt;,to close the thread and it would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Apr 2018 21:40:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/GetHTTP-making-multiple-api-calls-with-changing-parameter/m-p/199431#M76647</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-04-01T21:40:02Z</dc:date>
    </item>
  </channel>
</rss>

