discourse-siw-sdk
This npm module allows to consume the discourse api
Last updated 3 years ago by wuhanyu .
MIT · Original npm · Tarball · package.json
$ cnpm install discourse-siw-sdk 
SYNC missed versions from official npm registry.

Discourse-SDK

Installation

Using npm

npm install --save discourse-sdk

Usage

In node.js

 var discourse = require('discourse-sdk');

 var client = new discourse('API-URL', 'API-KEY', 'USER-NAME');

Categories

Gets a list of categories

client.getCategories({},function(error, body, httpCode) {              
  console.log(body);                
});

Create new category

client.createCategory('name', 'color', 'text_color', 'parent_category_id',function(error, body, httpCode) {              
  console.log(body);                
});

Get category Latest Topic

client.getCategoryLatestTopic('category_slug', 'params',,function(error, body, httpCode) {              
  console.log(body);                
});

Topics

Create new Topic

client.createTopic('title', 'raw', 'category' ,function(error, body, httpCode) {              
  console.log(body);                
});

Get Created Topics by given user

client.getCreatedTopicsfunction('username' ,function(error, body, httpCode) {              
  console.log(body);                
});

Get Last Created Post Id

client.getLastPostId(function(error, body, httpCode) {              
  console.log(body);                
});

Get Post by Id

client.getPost('post-id',function(error, body, httpCode) {              
  console.log(body);                
});

Users

Create New User

client.createUser('name', 'email', 'username', 'password', 'active',function(error, body, httpCode) {              
  console.log(body);                
});

Delete User

client.deleteUser('id','username', function(error, body, httpCode) {              
  console.log(body);                
});

Get User Details

client.getUser('username', function(error, body, httpCode) {              
  console.log(body);                
});

Credits

discourse-api

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |