Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Endpoints

Kasper Isager edited this page Jan 28, 2015 · 17 revisions

Configuration

Get the current configuration

Authentication required

Request

GET /api/configuration HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Configuration": Object
}

Search

Perform a search

Authentication optional

Request

GET /api/search?Search=foo HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "SearchResults": Array,
    "SearchTerm": "foo",
    "SearchTerms": Array,
    "From": 1,
    "To": 29
}

Categories

Find all categories

Authentication optional

Request

GET /api/categories HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Categories": Object
}

Create a new category

Authentication required

Request

POST /api/categories HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo Bar",
    "UrlCode": "foo-bar"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Category": Object,
    "DiscussionTypes": Object
}

Find a category

Authentication optional

Request

GET /api/categories/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "AnnounceData": Array,
    "Categories": Array,
    "Category": Object,
    "CategoryID": "123",
    "CountDiscussions": "123",
    "Discussions": Array
}

Update a category

Authentication required

Request

PUT /api/categories/:id HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo Bar",
    "UrlCode": "foo-bar"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "AnnounceData": Array,
    "Categories": Array,
    "Category": Object,
    "CategoryID": "123",
    "CountDiscussions": "123",
    "Discussions": Array
}

Remove a category

Authentication required

Request

DELETE /api/categories/:id HTTP/1.1

Response

HTTP/1.1 200
Content-Type: application/json

{}

Follow a category

Authentication required

Request

POST /api/categories/:id/follow HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Unfollow a category

Authentication required

Request

POST /api/categories/:id/unfollow HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Discussions

Find all discussions

Authentication optional

Request

GET /api/discussions HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Announcements": Array,
    "Category": false,
    "CountDiscussions": "123",
    "Discussions": Array
}

Create a new discussion

Authentication required

Request

POST /api/discussions HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo Bar",
    "Body": "Lorem ipsum dolor sit amet",
    "CategoryID": 2
}

Response

The newly created discussion.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Discussion": Object,
    "Type": "Discussion"
}

Find a discussion

Authentication optional

Request

GET /api/discussions/:id HTTP/1.1

Response

The requested discussion if found and if the authorized user has permission to access it.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Category": Object,
    "Discussion": Object,
    "Page": "1"
}

Update a discussion

Authentication required

Request

PUT /api/discussions/:id HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo Bar",
    "Body": "Lorem ipsum dolor sit amet",
    "CategoryID": 2
}

Response

The updated discussion.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Discussion": Object,
    "Type": "Discussion"
}

Remove a discussion

Authentication required

Request

DELETE /api/discussions/:id HTTP/1.1

Response

The discussion was removed successfully.

HTTP/1.1 200 OK
Content-Type: application/json

Announce a discussion

Authentication required

Request

POST /api/discussions/:id/announce HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Unannounce a discussion

Authentication required

Request

POST /api/discussions/:id/unannounce HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Dismiss an announced discussion

Authentication required

Request

POST /api/discussions/:id/dismiss HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Sink a discussion

Authentication required

Request

POST /api/discussions/:id/sink HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Unsink a discussion

Authentication required

Request

POST /api/discussions/:id/unsink HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Close a discussion

Authentication required

Request

POST /api/discussions/:id/close HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Re-open a discussion

Authentication required

Request

POST /api/discussions/:id/open HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Bookmark a discussion

Authentication required

Request

POST /api/discussions/:id/bookmark HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Unbookmark a discussion

Authentication required

Request

POST /api/discussions/:id/unbookmark HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Create a new comment

Authentication required

Request

POST /api/discussions/:id/comments
Content-Type: application/json

{
    "Body": "Lorem ipsum dolor amet",
    "Format": "Markdown"
}

Response

The newly created comment.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Comment": Object
}

Update a comment

Authentication required

Request

PUT /api/discussions/comments/:id HTTP/1.1
Content-Type: application/json

{
    "Body": "Lorem ipsum dolor amet"
}

Response

The updated comment.

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Comment": Object
}

Remove a comment

Authentication required

Request

DELETE /api/discussions/comments/:id HTTP/1.1

Response

The comment was removed successfully.

HTTP/1.1 200 OK
Content-Type: application/json

{}

Find bookmarked discussions

Authentication required

Request

GET /api/discussions/bookmarks HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "CountDiscussions": "123",
    "Discussions": Array
}

Find own discussions

Authentication required

Request

GET /api/discussions/mine HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "CountDiscussions": "123",
    "Discussions": Array
}

Activities

Find all activities

Authentication optional

Request

GET /api/activities HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Activities": Array,
    "Filter": "public"
}

Create a new activity

Authentication required

Request

POST /api/activities HTTP/1.1
Content-Type: application/json

{
    "Comment": "Lorem ipsum dolor sit amet"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Activities": Array
}

Find an activity

Authentication required

Request

GET /api/activities/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "ActivityData": Array,
    "Comments": Array
}

Remove an activity

Authentication required

Request

DELETE /api/activities/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Create an activity comment

Request

POST /api/activities/:id/comments HTTP/1.1
Content-Type: application/json

{
    "Body": "Lorem ipsum dolor sit amet"
}

#### Response

```http
HTTP/1.1 200 OK
Content-Type: application/json

{
    "Comment": Object
}

Remove an activity comment

Request

DELETE /api/activities/comments/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Conversations

Find all conversations

Authentication required

Request

GET /api/conversations HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Conversations": Array
}

Create a new conversation

Authentication required

Request

POST /api/conversations HTTP/1.1
Content-Type: application/json

{
    "To": "",
    "Body": ""
}

Find a conversation

Authentication required

Request

GET /api/conversations/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Conversation": Object,
    "Messages": Array
}

Remove a conversation

Authentication required

Request

DELETE /api/conversations/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Create a new message

Authentication required

Request

POST /api/conversations/:id/messages HTTP/1.1
Content-Type: application/json

{
    "Body": ""
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Messages": Array
}

Users

Find all users

Authentication required

Request

GET /api/users HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "RecordCount": "123",
    "Users": Array
}

Create a new user

Authentication required

Request

POST /api/users HTTP/1.1
Content-Type: application/json

{
    "Name": "John Doe",
    "Email": "john@example.com",
    "Password": "foo",
    "RoleID": [123]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "AllowEditing": true,
    "Roles": Object,
    "User": Object,
    "UserRoles": Object
}

Find a user

Authentication optional

Request

GET /api/users/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Activities": Array,
    "Profile": Object,
    "UserRoles": Array
}

Update a user

Authentication required

Request

PUT /api/users/:id HTTP/1.1
Content-Type: application/json

{
    "Name": "John Doe",
    "Email": "john@example.com",
    "Password": "foo",
    "RoleID": [123]
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "AllowEditing": true,
    "Roles": Object,
    "User": Object,
    "UserRoles": Object
}

Remove a user

Authentication required

Request

DELETE /api/users/:id HTTP/1.1
Content-Type: application/json

{
    "Method": "keep|wipe|delete"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Get a summary of all users

Authentication optional

Request

GET /api/users/summary HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "UserData": Array
}

Roles

Find all roles

Authentication required

Request

GET /api/roles HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Roles": Array
}

Create a new role

Authentication required

Request

POST /api/roles HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo",
    "Description": "Lorem ipsum dolor sit amet",
    "PersonalInfo": false,
    "Permission": Array
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "PermissionData": Object
}

Find a role

Authentication required

Request

GET /api/roles/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Roles": Array
}

Update a role

Authentication required

Request

PUT /api/roles/:id HTTP/1.1
Content-Type: application/json

{
    "Name": "Foo",
    "Description": "Lorem ipsum dolor sit amet",
    "PersonalInfo": false,
    "Permission": Array
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "PermissionData": Object
}

Remove a role

Authentication required

Request

DELETE /api/roles/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{}

Moderation

Find all bans

Authentication required

Request

GET /api/moderation/bans HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Bans": Array
}

Create a new ban

Authentication required

Request

POST /api/moderation/bans HTTP/1.1
Content-Type: application/json

{
    "BanType": "IPAdress|Email|Name",
    "BanValue": "127.0.0.1|john@example.com|johndoe",
    "Notes": "Lorem ipsum dolor sit amet"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

[]

Update a ban

Authentication required

Request

PUT /api/moderation/bans/:id HTTP/1.1
Content-Type: application/json

{
    "BanType": "IPAdress|Email|Name",
    "BanValue": "127.0.0.1|john@example.com|johndoe",
    "Notes": "Lorem ipsum dolor sit amet"
}

Response

HTTP/1.1 200 OK
Content-Type: application/json

[]

Remove a ban

Authentication required

Request

DELETE /api/moderation/bans/:id HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

[]

Logs

Find all spam log entries

Authentication required

Request

GET /api/logs/spam HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Log": Array,
    "RecordCount": "123"
}

Find all moderation log entries

Authentication required

Request

GET /api/logs/moderation HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Log": Array,
    "RecordCount": "123"
}

Find all change log entries

Authentication required

Request

GET /api/logs/edits HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "Log": Array,
    "RecordCount": "123"
}
Clone this wiki locally