Following users
Create a follow relationship between two users. The initiator becomes a follower of the target user.johndoe follow janedoe.
Response:
- A new
Followrecord is created with a composite primary key janedoe’s follower count is incrementedjohndoe’s following count is incremented- A follow notification is sent to
janedoe
404 Not Found- Either user does not exist or action blocked409 Conflict- Already following this user403 Forbidden- Cannot follow yourself
Unfollowing users
Remove a follow relationship. This operation uses a transaction to ensure atomicity.- The
Followrecord is deleted atomically - Both follower and following counts are decremented
- Transaction ensures counts stay consistent
404 Not Found- User does not exist or action blocked409 Conflict- Not currently following this user
Getting followers list
Retrieve all followers for a specific user.Getting following list
Retrieve all accounts that a user is following.Blocking users
Block a user to prevent all interactions. Blocked users cannot:- See your posts
- Follow you
- Like or comment on your content
johndoe block spammer.
Response:
BlockedAccount table uses a composite primary key:
BlockingUserID- The user who initiated the blockBlockedAccountId- The user being blocked
404 Not Found- User does not exist409 Conflict- Already blocking this user403 Forbidden- Cannot block yourself
Unblocking users
Remove a block to restore normal interactions.404 Not Found- User does not exist409 Conflict- Not currently blocking this user
Adding close friends
Add a user to your close friends list for special content sharing.janedoe to johndoe’s close friends list.
Response:
CloseFriend table uses a composite primary key:
AddingUserID- The user creating the close friend relationshipCloseFriendAccountId- The user being added as a close friend
404 Not Found- User does not exist409 Conflict- Already added this user as close friend403 Forbidden- Cannot add yourself
Removing close friends
Remove a user from your close friends list.404 Not Found- User does not exist409 Conflict- User not in close friends list