<?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 does the InvokeHTTP processor interacts with the incoming Flow file? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105641#M68519</link>
    <description>&lt;P&gt;
	Hi &lt;A rel="user" href="https://community.cloudera.com/users/2855/lubinlemarchand.html" nodeid="2855"&gt;@Lubin Lemarchand&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;
	I juste tested the InvokeHTTP to post messages in my Facebook profile and it does work. I tried with the following dataflow:&lt;/P&gt;&lt;UL&gt;
	&lt;LI&gt;GetFile processor: the input file will contain the message that I want to send as well as my access_token
	&lt;UL&gt;
		&lt;LI&gt;Input directory: /tmp/input&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;	&lt;LI&gt;InvokeHTTP processor: call the Graph API to post a message in my feed. I used these configurations:
	&lt;UL&gt;
		&lt;LI&gt;HTTP Method: POST&lt;/LI&gt;		&lt;LI&gt;URL: &lt;A href="https://graph.facebook.com/me/feed" target="_blank"&gt;https://graph.facebook.com/me/feed&lt;/A&gt;&lt;/LI&gt;		&lt;LI&gt;Always output response: True. This is optional. This will make the processor send the response to the PutFile processor even if there were an error (ex. bad token). This can be helpful for debugging.&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;	&lt;LI&gt;PutFile processor: Save the response JSON in a file
	&lt;UL&gt;
		&lt;LI&gt;Directory: /tmp/output&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;
	To post a hello message on my feed I created a text file with the following content : "message=Hello+from+NiFi&amp;amp;access_token=PUT-YOUR-ACCESS-TOKEN-HERE" in /tmp/input and the message was posted in my profile.&lt;/P&gt;&lt;P&gt;
	ps: use the data provenence tool for debugging. It is very useful.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 20:33:04 GMT</pubDate>
    <dc:creator>ahadjidj</dc:creator>
    <dc:date>2016-03-03T20:33:04Z</dc:date>
    <item>
      <title>How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105638#M68516</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I made a Nifi template with 3 processor : GetFile --&amp;gt;InvokeHttp--&amp;gt;PutHdfs.&lt;/P&gt;&lt;P&gt;InvokeHttp makes a POST request to the facebook graph api and receives a JSON which is wrote in hdfs by PutHdfs. The issue i have is that the request i make doesn't seem to depend on the file read by GetFile. I read the Nifi documentation on InvokeHttp but i didn't find/understand the answer, hence my question.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 16:23:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105638#M68516</guid>
      <dc:creator>lubinlemarchand</dc:creator>
      <dc:date>2016-03-02T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105639#M68517</link>
      <description>&lt;P&gt;I was able to generate and send JSON to InvokeHttp POST using a test endpoint (http://httpbin.org/post), it read the incoming flow file contents (the JSON) and correctly responded based on the input file.&lt;/P&gt;&lt;P&gt;Does the InvokeHttp response make sense for what you intend to send via POST?  If not, you may need to (if you haven't already) set the "mime.type" attribute to "application/json" before sending the flow file to InvokeHttp. This can be done with the UpdateAttribute processor (see my example template below).&lt;/P&gt;&lt;P&gt;If GetFile still doesn't seem to work, perhaps try ListFile followed by FetchFile. Having said that, I wouldn't think this would make a difference, I suspect there's something else in the flowfile content and/or attributes (or a lack thereof) that causes InvokeHttp to not respond as intended.&lt;/P&gt;&lt;P&gt;My template is available as a Gist (&lt;A target="_blank" href="https://gist.github.com/mattyb149/6c09608b09ea07639e1a"&gt;here&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 06:00:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105639#M68517</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2016-03-03T06:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105640#M68518</link>
      <description>&lt;P style="margin-left: 20px;"&gt;Thank you very much. I'll have a look at it tomorrow.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 06:36:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105640#M68518</guid>
      <dc:creator>lubinlemarchand</dc:creator>
      <dc:date>2016-03-03T06:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105641#M68519</link>
      <description>&lt;P&gt;
	Hi &lt;A rel="user" href="https://community.cloudera.com/users/2855/lubinlemarchand.html" nodeid="2855"&gt;@Lubin Lemarchand&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;
	I juste tested the InvokeHTTP to post messages in my Facebook profile and it does work. I tried with the following dataflow:&lt;/P&gt;&lt;UL&gt;
	&lt;LI&gt;GetFile processor: the input file will contain the message that I want to send as well as my access_token
	&lt;UL&gt;
		&lt;LI&gt;Input directory: /tmp/input&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;	&lt;LI&gt;InvokeHTTP processor: call the Graph API to post a message in my feed. I used these configurations:
	&lt;UL&gt;
		&lt;LI&gt;HTTP Method: POST&lt;/LI&gt;		&lt;LI&gt;URL: &lt;A href="https://graph.facebook.com/me/feed" target="_blank"&gt;https://graph.facebook.com/me/feed&lt;/A&gt;&lt;/LI&gt;		&lt;LI&gt;Always output response: True. This is optional. This will make the processor send the response to the PutFile processor even if there were an error (ex. bad token). This can be helpful for debugging.&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;	&lt;LI&gt;PutFile processor: Save the response JSON in a file
	&lt;UL&gt;
		&lt;LI&gt;Directory: /tmp/output&lt;/LI&gt;	&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;
	To post a hello message on my feed I created a text file with the following content : "message=Hello+from+NiFi&amp;amp;access_token=PUT-YOUR-ACCESS-TOKEN-HERE" in /tmp/input and the message was posted in my profile.&lt;/P&gt;&lt;P&gt;
	ps: use the data provenence tool for debugging. It is very useful.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 20:33:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105641#M68519</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-03-03T20:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105642#M68520</link>
      <description>&lt;P&gt;Adding the update processor  with the mime.type attribute set to "application/json" solved the problem. *insert thank you gif*&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 21:19:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105642#M68520</guid>
      <dc:creator>lubinlemarchand</dc:creator>
      <dc:date>2016-03-03T21:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105643#M68521</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/2056/ahadjidj.html" nodeid="2056"&gt;@Abdelkrim Hadjidj&lt;/A&gt;&lt;P&gt;Thank you for your answer, the always output response property will certainly be usefull. I'm not trying to post anything on facebook. I want to make multiple requests to the graph API. According to the facebook documentation, i need to post a json with a batch of my requests (or something close). If you have any infos about that or an example, please post it under this question : &lt;A href="https://community.hortonworks.com/questions/20104/trying-to-make-multiple-request-to-facebook-graph.html" target="_blank"&gt;https://community.hortonworks.com/questions/20104/trying-to-make-multiple-request-to-facebook-graph.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 21:31:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105643#M68521</guid>
      <dc:creator>lubinlemarchand</dc:creator>
      <dc:date>2016-03-03T21:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: How does the InvokeHTTP processor interacts with the incoming Flow file?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105644#M68522</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2855/lubinlemarchand.html" nodeid="2855"&gt;@Lubin Lemarchand&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;The approach that I gave is general and can be applied to issue any post request to Facebook. Posting something to a feed was just an example.&lt;/P&gt;&lt;P&gt;To achieve what you are trying to do, just put your batch request JSON together with access_token in the input file and you will get the results JSON. Here is an example that's working for me:&lt;/P&gt;&lt;P&gt;batch=[{"method":"GET", "relative_url":"me"},{"method":"GET", "relative_url":"me/friends"}]&amp;amp;access_token=your-access-token&lt;/P&gt;&lt;P&gt;In the InvokeHTTP use the following URL: &lt;A href="https://graph.facebook.com/" target="_blank"&gt;https://graph.facebook.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 22:21:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-does-the-InvokeHTTP-processor-interacts-with-the/m-p/105644#M68522</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2016-03-03T22:21:19Z</dc:date>
    </item>
  </channel>
</rss>

