I need to send a private message from Salesforce to Facebook using the Facebook REST API. I have the access_key, app_key, and user id. I can send a private message by using JavaScript given by Facebook FB.init but for that we need to login by providing username and password if the user is not logged in in that browser. I need to send a private message via the REST API. By reading the Facebook docs, I see that Facebook uses SASL Authentication for chat. What are the endpoint url and parameter for sending private messages?


It's not currently possible from the Force.com Toolkit for Facebook. The Facebook REST (Graph) API doesn't allow it - see the doc page on message - there is only GET, no POST. The only thing you can do is use the JavaScript SDK to let the user send a message from a Visualforce page.

Looking at the Facebook Chat docs, there is a PHP example there with the endpoint (chat.facebook.com) and code to send messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.