Work with categories

Description

Work with categories

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
categories(url = NULL, key = NULL, user = NULL, ...)

category(category, url = NULL, key = NULL, user = NULL, ...)

category_latest_topics(category, url = NULL, key = NULL, user = NULL, ...)

category_top_topics(category, url = NULL, key = NULL, user = NULL, ...)

category_new_topics(category, url = NULL, key = NULL, user = NULL, ...)

category_create(category, color, text_color, description = NULL,
  permissions = NULL, parent_category = NULL, url = NULL, key = NULL,
  user = NULL, ...)

Arguments

url

Base url for a Discourse installation. See disc_setup

key

Your api key on the Discourse installation. See disc_setup

user

Your user name on the Discourse installation. See disc_setup

...

Named parameters passed on to GET, POST, PUT, or DELETE

category

Category name. required

color

A color by name or hex string. optional

text_color

A color by name or hex string. optional

description

Description of the category. optional

permissions

Permissions - a list with the group name and permission_type which is an integer: 1 = Full, 2 = Create Post, 3 = Read Only. optional

parent_category

x. optional

Details

Apprently there's no ability to delete categories via the API.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
# all categories
categories()

# a specfic category
category("questions")
category("packages")

# latest topics for a category
category_latest_topics("packages")

# top topics for a category
category_top_topics("packages")

# new topics for a category
category_new_topics("packages")

# create a category
category_create("stuff", "F7941D", "FFFFFF", "My new category")

## End(Not run)