Created 07-22-2016 05:31 AM
Dear All,
I'm able to receive feeds from facebook using faceebook grap API on NiFi but the issue is need to get entire feeds in one shot like (next all pages ) it getting only one page .
Thanks in advance
Created 07-22-2016 06:27 AM
I think you could try the following approach:
GenerateFlowFile to generate one single custom flow file
UpdateAttribute to give to this flow file the URL to request
InvokeHTTP to request the data to the Facebook API based on the attributes of the flow file
Then you add two success relationships : one to continue your flow as you expect, one to extract the "next" URL using EvaluateJsonPath to update the attribute of the flow file that contains the URL to request and send back this flow file to the InvokeHTTP.
This way you'll loop over the "next" pages to get all the data.
This probably needs to be adjusted with the specifics of Facebook API but this is an idea. If this is not helping and if you can share a template of your workflow, I may have a look.
Hope this helps.
Created on 08-02-2016 05:36 AM - edited 08-19-2019 01:09 AM
I tried as u mentioned and able to get next page link but not able to give url of next page link into Update attribute
Please Help me to solve this issue
Created 08-02-2016 06:03 AM
If $.paging.next contains the exact url you want to request, then in EvaluateJsonPath instead of naming your attribute 'next', you could directly call it 'target' to update the value of 'target' in the FlowFile. Then you directly link your EvaluateJsonPath processor back to InvokeHTTP processor.
You may also want to use a RouteOnAttribute processor to have an exit path depending of the value of 'target' when you reach the last page.
Let me know if it helps.
Created 08-02-2016 07:18 AM
Thanks @Pierre Villard
Created 08-02-2016 08:09 AM
I'd rather directly link the 'matched' relationship from EvaluateJsonPath to InvokeHTTP. You don't want to use the UpdateAttribute anymore since you have updated the 'target' value. Also you should change the property 'destination' to 'flow file attributes' in your EvaluateJsonPath processor.
Created 08-02-2016 09:44 AM
Please share your template, I'll have a look.
Created 08-02-2016 11:23 AM
I am not able to execute the workflow because the token is no longer valid:
{"error":{"message":"Error validating access token: Session has expired on Tuesday, 02-Aug-16 03:00:00 PDT. The current time is Tuesday, 02-Aug-16 04:21:58 PDT.","type":"OAuthException","code":190,"error_subcode":463,"fbtrace_id":"GKN7NpU0NhS"}}
Created 08-02-2016 09:37 AM
Thanks @Pierre Villard
Created 02-25-2017 05:36 PM
does it get resolved? if yes then how? plz share @Pierre Villard