How can I post a message on facebook using restfb

this is my java code using resfb lib to post something to my facebook group feed:

FacebookClient fb=new DefaultFacebookClient(token);
FacebookType message=fb.publish(pid+"/feed",FacebookType.class,Parameter.with("message", description));

Now, what am I doing to publish a published article?

Many thanks for your help!

+4
source share
1 answer

The Graph API does not provide an explicit sharing operation, but you can create a message that is a link to another message that should be displayed as a shared resource. Something like that:

fb.publish("me/feed", FacebookType.class, Parameter.with("link", "https://www.facebook.com/10152237769155733"));
+1
source

Source: https://habr.com/ru/post/1530062/


All Articles