Sending private messages through Facebook API

101,023

Solution 1

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.

Solution 2

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.*

Solution 3

You can do it using CHAT API. But it is limited plain text messages.

Share:
101,023

Related videos on Youtube

mixdev
Author by

mixdev

Updated on July 09, 2022

Comments

  • mixdev
    mixdev almost 2 years

    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.

    • Somnath Muluk
      Somnath Muluk about 12 years
      Now it is possible to send private messages through Facebook API. I have given solution.
    • Trevor
      Trevor over 10 years
    • alhelal
      alhelal over 2 years
      @SomnathMuluk where is your answer?
  • mixdev
    mixdev over 13 years
    But that's just read only access. Right? Can we SEND a message with it?
  • Mark Mayo
    Mark Mayo over 13 years
    yeah currently the only access to the messages component at all is via registered access, and even then it's only read. When the new messaging system comes in, maybe you'll get it, but currently - no.
  • Mark Mayo
    Mark Mayo over 13 years
    developers.facebook.com/blog/post/428 - "To comply with existing policies and laws that prohibit unsolicited email, and ensure that users are in control of their inbox, we aren’t currently permitting developers to send messages to @facebook.com email addresses, and have updated our policies to reflect this."
  • Mark Mayo
    Mark Mayo over 13 years
    developers.facebook.com/blog/post/291 - "While we currently don't allow applications to send messages through this API, we're always thinking about new functionality to offer through Facebook Platform. "
  • kohlehydrat
    kohlehydrat about 13 years
    The iPhone facebook-app, which uses the Graph API, can send messages.
  • Mark Mayo
    Mark Mayo about 13 years
    May find that since it's an official app made by Facebook that they've turned it on just for that. Checked their documentation again today and it still says that (officially anyway) they don't allow apps to send messages through the API.
  • Even Cheng
    Even Cheng over 10 years
    this seemed to phase out after graph api was introduced
  • ElSajko
    ElSajko over 8 years
    But is there way to auto-initiate(by user) conversation-with-my-page ?
  • shukshin.ivan
    shukshin.ivan over 8 years
    By 2015 it is deprecated :(
  • Dellirium
    Dellirium about 6 years
    @EvenCheng can you elaborate a bit further, the documentation says it is possible, yet every time I try this i get an error message, what do you mean phased out after the graph api was introduced?
  • alhelal
    alhelal over 2 years
    I need some help on this. Can you explain your answer with a example