Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discourse-sdk

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discourse-sdk

This npm module allows to consume the discourse api

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

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

Keywords

FAQs

Package last updated on 01 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc