How Send Message Facebook Friend Through Graph API Using Accessstoken

Graph Api to send message to a non-friend on facebook

SHORT Answer

No you can't

Long Answer

If the conversation is between two Facebook Users :

No you can't use Graph API, because you won't get the mailbox permissions.

If you don't need to use the GRAPH API, consider the SEND Dialog, then it should be possible

https://developers.facebook.com/docs/sharing/reference/send-dialog

If the conversation is between a Facebook Page and a Facebook User

You can send only a message if the Facebook User initiated at first the chat with the Facebook Page.

As you noticed, none of these meet your Use case :)

I hope this answers your concern

Sending customized Facebook message using Graph API for inviting friends to a website

Are you using Javascript or PHP to interact with facebook?
Either way you are going to want to use the 'link' parameter in the post.
Here is a php example which also posts a picture. If you need a Javascript example let me know.
Hope this helps!

$attachment = array(
'message' => $customMessage,
'link' => $MY_LINK_HERE,
'source' => $source,
'name' => $blogTitle,
'picture' => $picture,
'caption' => 'caption of the link',
'description' => ''
);
$result = $facebook->api('/'.$uid.'/feed?access_token='.$access, 'post', $attachment);


Related Topics



Leave a reply



Submit