Fetch
/api/v2/post/fetch
Post
posts
jwt
pgn
Purpose
To allow a user to fetch all the posts he/she has created.
Body Content [input]
{
uid: string
}
Returns if valid [output]
{
posts: {
uid: string,
postID: string,
content: string,
posted_on: Date,
modified_on: Date,
reacts: string[],
groupID: string,
shareID: string,
comments: {
uid: string,
commentID: string,
reply_to: string,
posted_on: Date,
modified_on: Date,
reacts: string[],
visibility: string
}[],
visibility: string,
allow_comments: bool,
senderName: string,
senderUsername: string,
groupName: string
}[],
error: 0,
amount: int
}
What the API does
- Find all records from the
posts
collection having the same value for theiruid
field as that of theuid
passed. - Adds the name of the
group
to each of theposts
if they have a value for theirgroupID
field to thegroupName
field. - Appends the name and username of the poster to each
post
record to thesenderName
andsenderUsername
fields respectively.
Note: The owner of a post can see all the comments under that post irrespective of the visibility set on each comment.