Using the code below I was able to read how many reactions (in detailed) my posts in my Facebook page have received. https://restfb.com/cookbook/ Now I need to read how many people have seen the posts specially I need to limit the date. For example: how many people have seen my post with the id x, yesterday? I do not need list of people, just how many people have seen and also how many people have clicked to open in case there was a picture. Based on https://developers.facebook.com/docs/graph-api/reference/post/seen/ I wrote the code below: My code :
int postNumber=0
Connection<Post> results = fbclient.fetchConnection(pageID + "/feed", Post.class);
for(List<Post> mypage: results) {
for(Post posted: mypage) {
postNumber++;
String postID=posted.getId();
Post hasSeen=fbclient.fetchObject(postID+"/seen",Post.class, Parameter.with("fields",
"seen_time, total_count"));
System.out.println("post number "+ postNumber+ "has been seen by "+ hasSeen);
}}
The error is :
Received Facebook error response of type OAuthException: (#100) Tried accessing nonexisting field (seen) on node type (PagePost) (code 100, subcode null) 'null - null'
at com.restfb.exception.generator.DefaultFacebookExceptionGenerator$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookExceptionGenerator.java:174)
at com.restfb.exception.generator.DefaultFacebookExceptionGenerator.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookExceptionGenerator.java:61)
at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:794)
at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:721)
at com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:683)
at com.restfb.DefaultFacebookClient.fetchObject(DefaultFacebookClient.java:276)
Thanks a million in advance