Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-29-2016 10:56 AM
Hi,
I need to make a lot of request to the Facebook Graph API using Nifi.
I looked at the documentation https://developers.facebook.com/docs/graph-api/making-multiple-requests which tells me that i need to POST a JSON which contains the request i want to make in a batch format to a specific endpoint.
So i created a Nifi template with 3 processors : GetFile -->PostHTTP-->PutHDFS.
GetFile reads a very simple JSON file i made to test.
When i run the template, i have no error message. However, the HDFS file wrote is just a copy of my initial JSON file.
Any explanation / solution?
Thank you in advance.
Created 02-29-2016 06:23 PM
I don't think PostHTTP outputs the response as a flow file. If you are looking for the response to be in a flow file, try InvokeHttp (with HTTP Method property set to "POST") instead and send its "response" relationship to your PutHDFS processor.
Created 02-29-2016 06:23 PM
I don't think PostHTTP outputs the response as a flow file. If you are looking for the response to be in a flow file, try InvokeHttp (with HTTP Method property set to "POST") instead and send its "response" relationship to your PutHDFS processor.
Created 03-01-2016 11:10 AM
@mburgess Thank you for your answer. InvokeHttp seems to work since i got an answer from the graph API that i can write in HDFS.
However, i didn't manage to make this answer depend on my original JSON : whatever is writen in the file taken by the GetFile processor, even if it is not a JSON formated file, the answer is the same. I looked at the nifi documentation on InvokeHttp and tried to put something in the property "Attributes to send" but it did nothing so far.
Do you know how InvokeHttp interacts with the FlowFiles coming from GetFile?
Created 03-03-2016 04:41 PM
@Lubin Lemarchand
Since the information is splitted across two threads, I am putting it here for future references. This is how you can do batch requests on Facebook Graph API with InvokeHTTP:
Here is an example of an input file to execute two requests, get my Facebook url and get my friends list
batch=[{"method":"GET", "relative_url":"me"},{"method":"GET", "relative_url":"me/friends"}]&access_token=your-access-token
Created 03-04-2016 08:11 AM
Thank you very much. It works splendidly. I'm not too sure of what was wrong in my json but it doesn't matter anymore.
Created 06-13-2016 03:02 AM
Hi I am working on Small project for my school to get data from Facebook and do some analysis. If you have worked to get data from facebook using nifi, can you share your dashboard?
Created 07-12-2016 06:35 AM