I am developing an application which manages Facebook pages. I wanted to understand if there's any method where using API, we can communication with users who have commented on my page through private message.
Thanks in advance and reading the question.
Thanks,
Hardik
That would be the conversations endpoint: https://developers.facebook.com/docs/graph-api/reference/v2.3/page/conversations
Be aware that you canĀ“t initiate the communication, you can only reply to a user message and you can only send 2 messages before the user responds: https://developers.facebook.com/docs/graph-api/reference/v2.3/conversation/messages#publish
Related
I was trying to built a bot which interacts with multiple users.
The Microsoft Bot Builder seems nice to me.
I followed their examples and tried them out.
Bot Builder Restify and so on
There are few things which are not clear to me.
How can I post a message to bot rest endpoint?
The emulator seems to have been taking care of such details. But in a real application, in which format i should sent a message?
How does the bot interacts with multiple users? In the emulator, there is only one user, what happens if there are several persons talk to the bot at the same time in a real application?
I think "chatconnector" somehow doing the job, but I am not sure.
I hope someone could point out examples or give answers below to clarify these to me.
Thanks in advance!
1) Messages are sent using industry-standard REST and JSON over HTTPS. Although you can call the bot's endpoint directly, this would bypass channels and security. In the Microsoft Bot Framework architecture, clients communicate with a channel connector and the channel connector calls the bot. When the bot responds, it sends a message to the channel connector and the connector calls the client. The channel connectors transform messages from the channel's specific schema to the Bot Framework's generic activity schema and back. They also verify that callers are authorized using JWT tokens.
This documentation on Authentication might help clear things up some: https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-authentication
2) Group conversations are handled differently, depending on the channel. This sample demonstrates some of the group conversation features in the Bot Builder Node sdk: https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/core-GetConversationMembers
I've facebook account and a fan page defined within this account.
I'm using XMPP to send private messages using the following Java code
http://yauritux.wordpress.com/2011/09/24/facebook-chat-with-smack-xmpp-api/
I can easily send and receive messages using my user id and password.
However when I try to use my page user ID I'm getting the following error:
SASL authentication PLAIN failed: not-authorized (stack below).
I tried to use pidgin but I'm getting the same error.
Let me know if you've a solution or direction on how to send a message as a page and not as a user.
Thank you in advance,
Moshe
SASL authentication PLAIN failed: not-authorized:
at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:337)
at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:203)
at org.jivesoftware.smack.Connection.login(Connection.java:348)
at com.maiff.was.connectors.impl.fb.FBConsoleChatApp.login(FBConsoleChatApp.java:55)
at com.maiff.was.connectors.test.ConnectorTestMain.initFB(ConnectorTestMain.java:55)
at com.maiff.was.connectors.test.ConnectorTestMain.main(ConnectorTestMain.java:18)
Pages can only "reply" to user messages, and i am not sure if it even works with XMPP. Keep in mind that the Chat API is deprecated btw: https://developers.facebook.com/docs/chat/
Meaning, after April 2015 it will not work anymore, not even with users.
For Page conversations, there is a specific API endpoint to reply to messages: https://developers.facebook.com/docs/graph-api/reference/v2.2/conversation/messages
My company develop a product for customer support on Facebook and we want to give the representatives a way to contact the customer via Facebook Chat.
I have read the Chat API documentations and it is not clear whether users MUST be friends on Facebook in order to chat or is it just enough they both installed a Facebook app? more limitations?
any insight will be appreciated.
Thanks in advance for you answers,
Yaniv Hakim
Facebook provides an XMPP port to the outside world while internally it implements MQTT. As per XMPP specs, messaging works between two entities without they being in each other roster list (friend/contact list). However, Facebook seems to have this limitation as part of their own business requirement. I think even GoogleTalk disallows this if two federated entities try to send message to each other without being on the roster list.
In short, yes you can just send the message. You don't need a presence authorization from someone in order to send messages to them (in XMPP world). HOWEVER, some services has a policy of requiring this, despite the fact that this is not mandated by the XMPP specifications.
I'm adding a private messaging system to my app,
so users could send private message to their friends.
I thought I could use the send dialog, but the link param seems to be required.
Is there any reason to require that property ?
Is there any other way to send private messages ? (Except XMPP Chat)
Thanks.
No, those are your two only options (send dialog and chat api).
You can also let one user write on the other users wall and set the privacy so that only they can view the message, but that is not really what you're after from what I understand (neither is the chat api btw, since it works only if the two users are online at the time).
I found this thread which talks about it in length: how send message facebook friend through graph api using Accessstoken
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Facebook Api - send private messages to friends
I know that it is not officially possible to send private messages through FB API. Every thread in SO says so too. But I was using RockMelt browser and when you invite somebody, a private message is sent to them. Means it is possible to send private messages through API. More importantly, Facebook is okay with it.
Any guesses on how they are using it? Is it some HTTP POST trick using sockets? BTW, we are going to use this feature only on user initiated actions.
Reading messages is possible with the new messaging framework, available to registered developers only.
Have a read of this page - that's about all that I'm aware of currently:
http://developers.facebook.com/docs/reference/api/message
Sending, however, is not.
You can now view and respond to messages on Facebook Pages via the Graph API but you still can't initiate a conversation, only respond to a user that has already messaged you.
From the docs linked above:
*You can reply to a user's message by issuing an HTTP POST to /CONVERSATION_ID/messages with the following parameters [conversation id, message]. A conversation ID look like t_id.216477638451347.*
You can do it using CHAT API. But it is limited plain text messages.