Facebook Graph API to send message to friend - facebook

I had read the API reference, but still not sure if it's possible to send message to a friend? Suppose I had get access_token from user.
I want to use the API to display user's friends list in my Web UI, and the user can choose a friend and start to chat with the one.

Related

Sending private message to facebook friend (API)

I'm currently creating an app that generates a unique link that can be sent to a friend on facebook.
I want to be able to send the link to a specific person from a users friends list. Is this possible? I'm currently using the fb javascript api but can't seem to find any such functionality but posting on ones wall.
Thanks

Is it possible to send message as page to friend of authorized user using Facebook API

Is it possible for my Facebook app, with the authorization of the user, to send messages to the user's friends as a page? If so, how would one go about this? Would it be the Page Call to Action in the Graph API?
Thank you, I'm pretty new to the Facebook API.

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

Is it possible to send a message automatically with the Facebook Graph API to a Facebook user who is not a friend or user of the authorized application?
I know that we couldn't before.
but is there a method today?
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

Accessing Friends List on new FB APIs for non-app users

I am building an app where users can send picture messages to friends and would like users to see their Facebook friends list when they login through FB. However, I am confused by Facebook's new API information regarding the access that an app can have to display someone's list of friends. On the FB change log information page it says:
1) Friend list is no longer part of the default permission set and has its own permission: Asking for access to a person's friend list is now a separate permission that your app must request. The new permission is called user_friends.
2) Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.
https://developers.facebook.com/docs/apps/changelog
Does this mean that my app will only display to users their Friends that are also using my app? Is there no way for a User to see their entire friends list? And if not, how can I prompt the User to invite new friends to use my app?
Thanks.
Yes, that is exactly what it means, and for what you want to do there is no way to get the friends who did not authorize your App. But maybe you want to use the Send Dialog instead: https://developers.facebook.com/docs/sharing/reference/send-dialog
For that, you don't even need to authorize the user and he can choose the receiver on his own.

FB.ui request dialogs: preselecting some friends

FB.ui Request dialogs: (With method: 'apprequests') allow you to send a request from your app.
http://developers.facebook.com/docs/reference/dialogs/requests/
This says, you can specify one friend in the two value. However I want to specify N friends which are preselected, but can be edited. Is it possible in this widget. If not, What alternate widgets can I use
This isn't possible via that Facebook javascript sdk, most likely to be less spammy and not default to sending to every single person a user is friends with. The way to get around this would be to build your own dialog using the graph api. You would retrieve all the users that a person is friends with, present them with your own dialog to let them choose users, and then send graph api requests over for each request.
Update:
Per Facebook's blog post, you can only send invitations to users through their Requests dialog. And this dialog will not let you pre-populate all users as checked. Graph api can only send to other users that have authenticated with the app.