Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created September 26, 2011 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koenbok/1243614 to your computer and use it in GitHub Desktop.
Save koenbok/1243614 to your computer and use it in GitHub Desktop.
var api = new FB.Messages();
api.login("koenbok", "password", function(result) {})
api.threads.fetch({limit: 100, tags: ["inbox", "unread"]}, function(results) {}) // list with threads
api.threads.count({limit: 100, tags: ["inbox", "unread"]}, function(results) {}) // thread count
api.messages.fetch({thread:thread.id}, function(results) {}) // all messages for thread
api.messages.put({thread:thread.id, parent:message.id ...}, function(results) {}) // send a new message
api.events.subscribe("new.message", function(info) {}) // get notified of incoming messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment