-
Notifications
You must be signed in to change notification settings - Fork 59
Detailed API Documentation
{
"username": "username",
"password": "Password"
}{
"jwt": "JSON.Web.Token"
}Authenticate the User and provide them with a JWT token as a response.
Authorization: Bearer <token> (Optional for public view)
{
"id": "30761418-70e6-46dc-8af5-17670e78f293",
"username": "first",
"name": "Nice Name",
"avatar": "URL://updated-picture.png",
"bio": "Updated Bio",
"followerCount": 0,
"followingCount": 0,
"verified": false
}Get details of a given user by username.
Authorization: Bearer <token> (Optional for public view)
{
"id": "30761418-70e6-46dc-8af5-17670e78f293",
"username": "first",
"name": "Nice Name",
"avatar": "URL://updated-picture.png",
"bio": "Updated Bio",
"followerCount": 0,
"followingCount": 0,
"verified": false
}Get details of a given user by userid.
{
"username": "first",
"name": "Nice Name",
"bio": "Bio of 240 characters",
"avatar": "URL://picture.png"
}{
"id": "30761418-70e6-46dc-8af5-17670e78f293",
"username": "first",
"name": "Nice Name",
"avatar": "URL://picture.png",
"bio": "Bio of 240 characters",
"followerCount": 0,
"followingCount": 0,
"verified": false
}Create a new user.
Authorization: Bearer <token>
{
"name": "Nice Name",
"avatar": "URL://updated-picture.png",
"bio": "Updated Bio"
}{
"id": "30761418-70e6-46dc-8af5-17670e78f293",
"username": "first",
"name": "Nice Name",
"avatar": "URL://updated-picture.png",
"bio": "Updated Bio",
"followerCount": 0,
"followingCount": 0,
"verified": false
}Update bio/name/image of the authenticated user.
Authorization: Bearer <token>
201 Created
Follow the given user.
Authorization: Bearer <token>
201 Created (Success)
Un-follow the given user.
Authorization: Bearer <token>
-
page(int): Page number. -
size(int): Items per page.
Spring Data Page<User> object.
Get a paginated list of all followers of this user.
-
page(int): Page number. -
size(int): Items per page.
Spring Data Page<Post> object.
Get the paginated list of all posts.
Post object.
Get details of a post.
Authorization: Bearer <token>
{
"text": "Hello world!",
"hashtags": ["news", "tech"]
}Post object.
Create a new post for the authenticated user.
Authorization: Bearer <token>
200 OK
Delete a given post.
Authorization: Bearer <token>
201 Created (Returns new like count)
Like the given post.
-
page(int): Page number. -
size(int): Items per page.
Spring Data Page<Hashtag> object.
Get paginated list of top hashtags.
-
page(int): Page number. -
size(int): Items per page.
Spring Data Page<Post> object.
All posts of the given hashtag.