Write a friend from java on the facebook wall

Using the access token, I can get the facebookId person. Will someone please provide me an example of sending a message to a friend's wall from java? I am using api: com.restfb.

In particular, I need to include an attachment as part of my post; attachment - additional messages.

+4
source share
1 answer

See https://developers.facebook.com/docs/reference/api/user/#feed , part of which reads:

You can create a link, message, or status message by sending an HTTP POST request to the PROFILE_ID / feed connection

So, try creating a message with something like:

String uid = "..."; DefaultFacebookClient client = ...; FacebookType postId = client.publish( uid + "/feed", FacebookType.class, Parameter.with("message", "Hello, world"), Parameter.with("link", "http://www.google.com")); 

According to the documents, you can attach only one of the Facebook photos for publication.

+1
source

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


All Articles