This section describes the API endpoints for managing posts.
Base URL: /
Authentication:
Most API calls require authorization with a valid access token. You can obtain an access token by logging in with a username and password (refer to Accounts section).
page
(integer, optional): The page number to retrieve. Defaults to 1. /posts/?page=2
retrieves the second page of results.size
(integer, optional): The number of posts to return per page. Defaults to a value set by
the PageNumberPagination
class (typically 10). /posts/?size=25
returns 25 posts per page.{
"count": integer,
"next": "null|string", # Added for pagination links (if applicable)
"previous": "null|string", # Added for pagination links (if applicable)
"posts": [
# List of posts
]
}
{
"title": "string",
"content": "string"
}
{
"created_post": {
"code": "string",
"target": "string",
"title": "string",
"content": "string",
"author": {
"full_name": "string",
"username": "string",
"bio": "null|string",
"profile_image": "null|string",
"following_count": integer,
"follower_count": integer,
"is_follow": boolean,
"is_verify": boolean
},
"created": "string (date-time)",
"updated": "null|string (date-time)",
"like_count": integer,
"is_like": boolean,
"is_save": boolean,
"status": "string",
"views": integer,
"comment_count": integer
}
}
<code
>: The unique code of the post to update.{
"title": "string",
"content": "string"
}
{
"message": "Post updated successfully"
}
<code
>: The unique code of the post to delete.{
"message": "Post deleted successfully"
}
<code
>: The unique code of the post to save/unsave.{
"message": "You are now save/unsave <post_title>." (depending on action)
}
<code
>: The unique code of the post to like/unlike.{
"message": "You are now like/unlike <post_title>." (depending on action)
}
<code
>: The unique code of the post to retrieve.{
"post": {
"code": "string",
"target": "/post/9Qejlp8IXpe",
"title": "string",
"content": "string",
"author": {
"full_name": "string",
"username": "string",
"bio": "null|string",
"profile_image": "null|string",
"following_count": integer,
"follower_count": integer,
"is_follow": boolean,
"is_verify": boolean
},
"created": "string (date-time)",
"updated": "null|string (date-time)",
"like_count": integer,
"is_like": boolean,
"is_save": boolean,
"status": "string",
"views": integer,
"comment_count": integer
}
{
"posts": [
# List of posts liked by the current user
]
}
{
"posts": [
# List of posts saved by the current user
]
}