Posts
Posts related to Social
These are authenticated endpoints. You can visit authentication to get an access token.
These endpoints allow you to create, read, update and delete posts. Posts are the main content of a social network, can be created by any profile and can receive reactions and comments.
These endpoints support pagination and sorting. Read more about these features here.
The Post model
Prop | Type | Default |
---|---|---|
id | integer | - |
title | string | - |
body | string | - |
tags | Array<string> | - |
media | string | - |
created | string | - |
updated | string | - |
_count | object | - |
Query parameters
Not all of the properties of a post are returned by default. You can use the following optional query parameters to include additional properties in the response.
Prop | Type | Default |
---|---|---|
_author | boolean | false |
_comments | boolean | false |
_reactions | boolean | false |
Filtering
You can filter based on an entry in the tags array by using the _tag
query flag. You may only filter by one tag at a time.
Prop | Type | Default |
---|---|---|
_tag | string | - |
An example query filtering for posts with the tag my_tag
:
All posts
Retrieve all posts.
If you want to get all posts by a specific profile, you can use the posts by profile endpoint.
Single post
Retrieve a single post by its id.
Use the _author
, _comments
and/or _reactions
flags to get more data from this request.
All posts from following
Retrieve all posts from profiles that the authenticated user is following.
The data returned is similar to the all posts endpoint and accepts the same optional query flags.
Create post
Create a new post. Only the title
property is required, but we recommend at least including the body
and media
properties as well.
Please note that the media
property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 error response.
Update post
Update a post based on its id. This endpoint returns the updated post.
Please note that the media
property must be a fully formed URL that links to a live and publicly accessible image. The API will check the provided URL and if it cannot be accessed publicly you will receive a 400 error response.
Delete post
Delete a post based on its id.
Returns an empty 204 response on success.
React to post
React to a post with a symbol.
Returns the symbol, reaction count for that symbol, and the original post id.
The symbol
parameter should be an actual emoji. For example, to react to a post with a 👍 emoji, you would use the following endpoint: /social/posts/<id>/react/👍
You do not need to include a body for this request.
Comment on post
This endpoint allows a comment to be made on a post. The optional replyToId
property can be used to link this comment to an existing comment.
Delete comment from post
Deleting a comment will also delete all replies to that comment.
Delete a comment from a post.
Returns an empty 204 response on success.