Name: rocketchat-node
Owner: Rocket.Chat
Description: rocket-chat node api
Forked from: qeesung/rocketchat-node
Created: 2016-12-27 03:11:09.0
Updated: 2016-12-27 03:11:11.0
Pushed: 2016-11-18 06:49:09.0
Homepage: null
Size: 19
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A node.js module, which provides an object oriented wrapper for the RocketChat REST API.
RocketChat official website address can be found here . RocketChat REST API document can be found here.
This Lib library package the following functions:
Install with the node package manager npm:
m install rocketchat
or
Install via git clone:
t clone https://github.com/qeesung/rocketchat-node.git
rocketchat-node
m install
RocketChatApi = require('rocketchat').RocketChatApi;
rocketChatApi = new RocketChatApi('http', config.host, config.port, config.user, config.password);
etChatApi.version(function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.login(function(err,body){
if(err)
console.log(err);
else
console.log(body);
You don't have to log in every time, and automatically log on when you call the other interface.
etChatApi.logout(function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.getPublicRooms(function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.joinRoom(roomID ,function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.getUnreadMsg(roomID ,function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.createRoom(roomName ,function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.leaveRoom(roomID ,function(err,body){
if(err)
console.log(err);
else
console.log(body);
etChatApi.sendMsg(roomID, message, function(err,body){
if(err)
console.log(err);
else
console.log(body);
More information can be found by checking RocektChat REST API
RocketChatApi Options:
<string>
: Typically 'http:' or 'https:'<string>
: The hostname for your jira server<int>
: The port your jira server is listening on (probably 80 or 443)<string>
: The username to log in with<string>
: Keep it secret, keep it safe