Discourse Mozilla GCM API (0.1.4)

Download OpenAPI specification:Download

API to create/manage namespaced groups and categories on a Discourse instance.

Other Discourse APIs

Authentication

api_key_auth

Security Scheme Type API Key
Header parameter name: X-API-KEY

Groups

Create group

If user_ids are specified which aren't associated with an account on Discourse already, accounts will be created associated with those user_ids.

Authorizations:
Request Body schema: application/json
name
required
string
description
string
users
Array of strings (Auth0 User ID)

Responses

Response Schema: application/json
id
integer (group_id)
discourse_group_name
string (discourse_group_name)

group name used on discourse (will be namespaced, could be shortened or have naming conflicts resolved)

Request samples

Content type
application/json
{
  • "name": "Tea Lovers",
  • "description": "For those who love tea",
  • "users": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "id": 412,
  • "discourse_group_name": "mdm-tea-lovers"
}

Get group

Authorizations:
path Parameters
id
required
integer (group_id)
Example: 412

The group ID

Responses

Response Schema: application/json
name
string
description
string
users
Array of strings (Auth0 User ID)
discourse_group_name
string (discourse_group_name)

group name used on discourse (will be namespaced, could be shortened or have naming conflicts resolved)

Response samples

Content type
application/json
{
  • "name": "Tea Lovers",
  • "description": "For those who love tea",
  • "users": [
    ],
  • "discourse_group_name": "mdm-tea-lovers"
}

Update group

Passing a list of users here will reset the membership of the group to only those in the list. Users can be added/removed using the /group/{id}/users route. Users which don't yet exist in Discourse will be created.

Authorizations:
path Parameters
id
required
integer (group_id)
Example: 412

The group ID

Request Body schema: application/json
name
string
description
string
users
Array of strings (Auth0 User ID)

Responses

Response Schema: application/json
discourse_group_name
string (discourse_group_name)

group name used on discourse (will be namespaced, could be shortened or have naming conflicts resolved)

Request samples

Content type
application/json
{
  • "name": "We Love Tea"
}

Response samples

Content type
application/json
{
  • "discourse_group_name": "mdm-we-love-tea"
}

Remove group

Authorizations:
path Parameters
id
required
integer (group_id)
Example: 412

The group ID

Responses

Add or remove users

If users passed here don't yet exist in Discourse, they'll be created.

Authorizations:
path Parameters
id
required
integer (group_id)
Example: 412

The group ID

Request Body schema: application/json
add
Array of strings (Auth0 User ID)
remove
Array of strings (Auth0 User ID)

Responses

Request samples

Content type
application/json
{
  • "add": [
    ],
  • "remove": [
    ]
}

Categories

Create category

Groups passed will be subscribed to the category. The category's topics won't be shown on the global /latest view.

Authorizations:
Request Body schema: application/json
name
required
string
description
string
groups
Array of integers (group_id) [ items ]

Array of groups which should be subscribed to the category

Responses

Response Schema: application/json
id
integer (category_id)
email_in
string <email>
url
string

Request samples

Content type
application/json
{
  • "name": "Coffee Club",
  • "description": "Public discussion of the Coffee Club's activities",
  • "groups": [
    ]
}

Response samples

Content type
application/json
{}

Get category

Authorizations:
path Parameters
id
required
integer (category_id)
Example: 123

The category ID

Responses

Response Schema: application/json
name
string
description
string
groups
Array of integers (group_id) [ items ]

Array of groups which should be subscribed to the category

email_in
string <email>
url
string

Response samples

Content type
application/json
{}

Update category

Passing a list of groups here will reset the subscribed groups on the category to only those in the list.

Authorizations:
path Parameters
id
required
integer (category_id)
Example: 123

The category ID

Request Body schema: application/json
name
string
description
string
groups
Array of integers (group_id) [ items ]

Array of groups which should be subscribed to the category

Responses

Response Schema: application/json
email_in
string <email>
url
string

Request samples

Content type
application/json
{
  • "name": "Coffee Club",
  • "description": "Public discussion of the Coffee Club's activities",
  • "groups": [
    ]
}

Response samples

Content type
application/json
{}

Archive category

Category will be made read only and moved under the "Archives" parent category.

Authorizations:
path Parameters
id
required
integer (category_id)
Example: 123

The category ID

Responses

Users

Get user

Authorizations:
path Parameters
id
required
string (Auth0 User ID)
Example: ad|Mozilla-LDAP|lmcardle

The user ID

Responses

Response Schema: application/json
username
string
url
string
groups
Array of integers (group_id) [ items ]

Response samples

Content type
application/json
{}