Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 1.2 KB

README.md

File metadata and controls

43 lines (27 loc) · 1.2 KB

Kabam-plugin-private-message

Kabam plugin for sending and recieving private message

Build Status

It exposes 3 routes

GET /api/messages?limit=10&offset=0

Get all recent messages for current authenticated user, in reverse chronological order - the most recent messages on top. Limit and offset can be ommited.

GET /api/messages/:username?limit=10&offset=0

Get all recent messages of dialog between current authenticated user and other one with :username. Messages are sorted in chronological order - the most recent on top. Limit and offset can be ommited.

POST /api/messages/:username

Sends the message to :username. Mandatory parameters are username (string) and message (string). Optional parameter is title (string)

When user receives message, the kabamKernel emits event.

See example

MWC.on('notify:pm',function(pm){
      console.log('Sendind email to '+pm.user.username+' with text "' + pm.message+'" from user "'+pm.from.username+'"');
});