Skip to content
Mateusz Donhefner edited this page Jan 18, 2021 · 4 revisions

Posts

Endpoint for handling posts.

Table of Contents

Posts

Create new post

Permission : Only logged users are allowed.

Command Method Route Description
Create POST /{culture}/api/Posts Adds a new post.

Call to this API method will result in the creation of a new post according to the arguments passed in the request body. The format of the arguments in the request body is JSON.

Request body will be in the following format:

{
  "id": <guid>,
  "discussionId": <guid>,
  "body": <string>
}

The response to this call will return id of newly created post:

{
  <guid>
}

Edit post

Permission : Only post owner is allowed.

Update Method Route Description
Details PUT /{culture}/api/Posts/{id} Updates an existing post selected by id.

Call to this API method will result in the updating a post with selected id. Arguments are passed in the request body. The format of the arguments in the request body is JSON.

Request body will be in the following format:

{
  "id": <guid>,
  "body": <string>,
}

The response to this call will return status code 204 if a post was edited correctly.

Delete post

Permission : Only post owner is allowed.

Command Method Route Description
Delete DELETE /{culture}/api/Posts/{id} Deletes a post with selected id.

Call to this API method will result in deleting a post with selected id. The response to this call will return status code 204 if a post was deleted correctly.

Pin post

Permission : Only logged users with administrator or moderator role are allowed.

Command Method Route Description
Pin PUT /{culture}/api/Posts/{id}/pin Pins an existing post selected by id.

Call to this API method will result in pinning a post with selected id. The response to this call will return status code 204 if a post was pinned correctly.

Unpin post

Permission : Only logged users with administrator or moderator role are allowed.

Command Method Route Description
Unpin PUT /{culture}/api/Posts/{id}/unpin Unpins an existing post selected by id.

Call to this API method will result in unpinning a post with selected id. The response to this call will return status code 204 if a post was unpinned correctly.

Clone this wiki locally