Posts

This section describes the endpoints for managing posts.

Post Model

The Post object represents a post in the system.

Post Object
{
    "id": 0,
    "title": "string",
    "content": "string",
    "poster": 0,
    "post_date": 0,
    "likes": 0,
    "likers": [0],
    "nsfw": false,
    "belongs_to": 0,
    "edited": false,
    "edited_at": 0
}

Endpoints

/posts [GET]

Get a list of all posts, sorted by date (newest first).

Return Example

* /posts [POST]

Create a new post.

Request Example

Return Example

/posts/{id} [GET]

Get a single post by its ID.

Return Example

* /posts/{id}/edit [PUT]

Edit a post by its ID. You can only edit your own posts.

Request Example

/users/{id}/posts [GET]

Get all posts made by a specific user.

/communities/{id}/posts [GET]

Get all posts made in a specific community.

* /posts/{id}/like [POST]

Like a post by its ID.

* /posts/{id}/unlike [POST]

Remove a like from a post by its ID.

* /posts/{id}/haveiliked [GET]

Check if the authenticated user has liked a post.

Return Example

Last updated