This section contains API requests related to user authentication and management.
POST /auth/register
// Sample Response
{
"success": true,
"data": {
"user": {
"id": 263,
"handle": "ankitbhusal200"
},
"refreshToken": "...",
"accessToken": "..."
}
}
Register a new user account.
POST /auth/login
// Sample Response
{
"success": true,
"data": {
"user": {
"id": 239,
"handle": "itsankitbhusal"
},
"accessToken": "...",
"refreshToken": "..."
}
}
Login with existing username and password.
GET /auth/token
// Sample Response
{
"success": true,
"data": {
"accessToken": "..."
}
}
Get a new access token using refresh token.
GET /auth/users
// Sample Response
{
"success": true,
"data": [
{
"id": 91,
"handle": "Iva_Funk51",
"role": "user"
},
{
"id": 150,
"handle": "Janelle.Moore",
"role": "user"
}
]
}
Get details of all users.
GET /auth/user/{handle}
// Sample Response
{
"success": true,
"data": {
"id": 239,
"handle": "itsankitbhusal",
"role": "admin"
}
}
Get user details by handle.
GET /auth/me
// Sample Response
{
"success": true,
"data": {
"id": 38,
"handle": "itsankitbhusal",
"role": "admin"
}
}
Get details of logged in user.
DELETE /auth/user/{id}
// Sample Response
{
"success": true,
"data": 1
}
Delete user by id.
PUT /auth/user/reset
// Sample Response
{
"success": true,
"data": "Email sent"
}
Change password of logged in user.
GET /auth/me
// Same as Get Logged In User response
Get details of logged in user for profile.
PUT /auth/{id}/admin
// Sample Response
{
"success": true,
"data": [1]
}
Upgrade normal user to admin.
POST /auth/reset
// Sample Response
{
"success": true,
"data": "Email sent"
}
Send reset password link after email verification.
GET /auth/reset/{token}
// Sample Response
{
"success": true,
"data": {
"user": {
"id": 251,
"handle": "manay"
},
"accessToken": "...",
"refreshToken": "..."
}
}
Reset user password using token.
This section contains API requests related to comments.
POST /comment/{confessionId}
// Sample Response
{
"success": true,
"data": {
"id": 11130,
"body": "comment",
"user_id": 239
}
}
Create a comment on a confession.
GET /comment/{id}
// Sample Response
{
"success": true,
"data": {
"id": 4,
"body": "Comment body...",
"user": {
"handle": "username"
}
}
}
Get a comment by id.
PUT /comment/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Update comment body.
DELETE /comment/{id}
// Sample Response
{
"success": true,
"data": 1
}
Delete a comment.
GET /comment/confession/{id}?page={page}&size={size}
// Sample Response
{
"success": true,
"data": {
"count": 5,
"rows": [
{
"id": 10301,
"body": "Comment body...",
"user": {
"handle": "username"
}
},
{
"id": 4820,
"body": "Comment body...",
"user": {
"handle": "username"
}
}
]
}
}
Get comments for a confession with pagination.
This section contains API requests related to commenting voting.
POST /comment-vote/up/{commentId}
// Sample Response
{
"success": true,
"data": "Comment vote created successfully."
}
Upvote a comment.
POST /comment-vote/down/{commentId}
// Sample Response
{
"success": true,
"data": "Comment vote created successfully."
}
Downvote a comment.
PUT /comment-vote/up/{commentId}
// Sample Response
{
"success": true,
"data": "Comment vote updated successfully."
}
Update downvote to upvote for a comment.
PUT /comment-vote/down/{commentId}
// Sample Response
{
"success": true,
"data": "Comment vote updated successfully."
}
Update upvote to downvote for a comment.
DELETE /comment-vote/up/{commentId}
// Sample Response
{
"success": false,
"message": "You cannot perform this action.",
"status": 400
}
Delete upvote on a comment.
DELETE /comment-vote/down/{commentId}
// Sample Response
{
"success": true,
"data": "Comment vote deleted successfully."
}
Delete downvote on a comment.
GET /comment-vote/count/{commentId}
// Sample Response
{
"success": true,
"data": {
"result": {
"upvoteCount": 2,
"downvoteCount": 1,
"totalVoteCount": 1
}
}
}
Get upvote and downvote count for a comment.
GET /comment-vote/comment/{commentId}
// Sample Response
{
"success": true,
"data": {
"id": 21020,
"user_id": 239,
"comment_id": 11131,
"vote_type": "up",
"user": {
"handle": "itsankitbhusal"
}
}
}
Get comment vote by logged in user for a comment.
This section contains API requests related to confessions.
GET /confession/?limit={limit}&page={page}
// Sample Response
{
"success": true,
"data": {
"confessions": [
{
"id": 1332,
"title": "Confession Title",
"user": {
"handle": "username"
}
},
{
"id": 72,
"title": "Confession Title",
"user": {
"handle": "username"
}
}
],
"page": 0,
"limit": 10
}
}
Get all confessions with pagination.
POST /confession
// Sample Response
{
"success": true,
"data": {
"id": 1333,
"title": "Confession Title",
"body": "Confession body...",
"user_id": 239
}
}
Create a new confession.
GET /confession/{id}
// Sample Response
{
"success": true,
"data": {
"id": 2,
"title": "Confession Title",
"body": "Confession body...",
"user": {
"handle": "username"
}
}
}
Get a confession by id.
PUT /confession/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Update confession title and body.
DELETE /confession/{id}
// Sample Response
{
"success": true,
"data": 1
}
Delete a confession.
PUT /confession/{id}/approve
// Sample Response
{
"success": true,
"data": [1]
}
Approve a pending confession.
GET /confession/pending
// Sample Response
{
"success": true,
"data": {
"confessions": [
{
"id": 8,
"title": "Pending Confession",
"user": {
"handle": "username"
}
}
]
}
}
Get all pending confessions.
POST /confession/user/{userId}
// Sample Response
{
"success": true,
"data": {
"confessions": [
{
"id": 31,
"title": "My Confession",
"user": {
"handle": "itsankitbhusal"
}
}
]
}
}
Get confessions by user id or logged in user if not provided.
POST /confession/user/handle/{handle}
// Sample Response
{
"success": true,
"data": {
"confessions": [
{
"id": 1298,
"title": "Confession Title",
"user": {
"handle": "username"
}
}
]
}
}
Get confessions by user handle.
GET /confession/search?title={title}
// Sample Response
{
"success": true,
"data": {
"confessions": [
{
"id": 1304,
"title": "Matching Confession",
"user": {
"handle": "username"
}
}
]
}
}
Search confessions by title.
This section contains API requests related to confession tags.
POST /confession-tag/{confessionId}/{tagId}
// Sample Response
{
"success": true,
"data": {
"confession_id": "675",
"tag_id": "111"
}
}
Create a confession tag.
DELETE /confession-tag/{confessionId}/{tagId}
// Sample Response
{
"success": true,
"data": "Delete confession tag successfully"
}
Delete a confession tag.
GET /confession-tag/{confessionId}
// Sample Response
{
"success": true,
"data": [
{
"tag": {
"name": "tag1"
}
},
{
"tag": {
"name": "tag2"
}
}
]
}
Get tags for a confession.
GET /confession-tag/tag/{tagId}
// Sample Response
{
"success": true,
"data": [
{
"confession": {
"title": "Related Confession",
"user": {
"handle": "username"
}
}
}
]
}
Get confessions related to a tag.
This section contains API requests related to confession voting.
POST /confession-vote/up/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote created successfully."
}
Upvote a confession.
POST /confession-vote/down/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote created successfully."
}
Downvote a confession.
PUT /confession-vote/up/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote updated successfully."
}
Update downvote to upvote for a confession.
PUT /confession-vote/down/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote updated successfully."
}
Update upvote to downvote for a confession.
DELETE /confession-vote/down/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote deleted successfully."
}
Delete downvote on a confession.
DELETE /confession-vote/up/{confessionId}
// Sample Response
{
"success": true,
"data": "Confession vote deleted successfully."
}
Delete upvote on a confession.
GET /confession-vote/
// Sample Response
{
"success": true,
"data": [
{
"id": 1,
"confession_id": 304,
"user": {
"handle": "username"
}
},
{
"id": 23266,
"confession_id": 222,
"user": {
"handle": "username"
}
}
]
}
Get all confession votes.
GET /confession-vote/user/{userId}
// Sample Response
{
"success": true,
"data": [
{
"id": 23239,
"confession_id": 909,
"user": {
"handle": "itsankitbhusal"
}
}
]
}
Get confession votes by user id or logged in user.
GET /confession-vote/confession/{confessionId}
// Sample Response
{
"success": true,
"data": {
"id": 23264,
"confession_id": 1331,
"vote_type": "down",
"user": {
"handle": "itsankitbhusal"
}
}
}
Get confession vote for a confession.
GET {{url}}/confession-vote/count/1331
// sample response
{
"success": true,
"data": {
"result": {
"totalVoteCount": 3,
"downvoteCount": 1,
"upvoteCount": 4
}
}
}
Here are the remaining sections of the complete markdown documentation for the SpeakUp Postman collection:
This section contains API requests related to user notifications.
POST /notification
// Sample Response
{
"success": true,
"data": {
"id": 12,
"message": "Notification message"
}
}
Create a notification.
GET /notification/user/{userId}
// Sample Response
{
"success": true,
"data": [
{
"id": 25,
"message": "Notification message"
}
]
}
Get notifications for a user.
GET /notification/{id}
// Sample Response
{
"success": true,
"data": {
"id": 4,
"message": "Notification message"
}
}
Get a notification.
PUT /notification/{id}
// Sample Response
{
"success": true,
"data": "Notification updated successfully"
}
Mark notification as read.
DELETE /notification/{id}
// Sample Response
{
"success": true,
"data": "Notification deleted successfully"
}
Delete a notification.
This section contains API requests related to reporting confessions and comments.
POST /reporting
// Sample Response
{
"success": true,
"data": {
"id": 118,
"reporter_id": 239,
"reported_object_type": "confession"
}
}
Report a confession or comment.
GET /reporting
// Sample Response
{
"success": true,
"data": [
{
"id": 118,
"reporter_id": 239,
"reported_object_type": "confession"
}
]
}
Get all reports.
GET /reporting/{id}
// Sample Response
{
"success": true,
"data": {
"id": 8,
"reporter_id": 219,
"reported_object_type": "confession"
}
}
Get a report.
DELETE /reporting/{id}
// Sample Response
{
"success": true,
"data": 1
}
Delete a report.
PUT /reporting/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Update a report.
GET /reporting/user/{userId}
// Sample Response
{
"success": true,
"data": [
{
"id": 15,
"reporter_id": 79,
"reported_object_type": "comment"
}
]
}
Get reports by a user.
GET /reporting/object/{type}
// Sample Response
{
"success": true,
"data": [
{
"id": 15,
"reported_object_type": "comment"
}
]
}
Get reports by object type - confession or comment.
GET /reporting/resolved/{boolean}
// Sample Response
{
"success": true,
"data": [
{
"id": 1,
"is_resolved": true
}
]
}
Get reports by resolved status.
PUT /reporting/resolve/comment/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Resolve a comment report.
PUT /reporting/resolve/confession/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Resolve a confession report.
This section contains API requests related to managing tags.
GET /tag
// Sample Response
{
"success": true,
"data": [
{
"id": 51,
"name": "tag1"
},
{
"id": 118,
"name": "tag2"
}
]
}
Get all tags.
POST /tag
// Sample Response
{
"success": true,
"data": {
"id": 119,
"name": "newtag"
}
}
Create a new tag.
GET /tag/{id}
// Sample Response
{
"success": true,
"data": {
"id": 1,
"name": "tag"
}
}
Get a tag.
PUT /tag/{id}
// Sample Response
{
"success": true,
"data": [1]
}
Update tag name.
DELETE /tag/{id}
// Sample Response
{
"success": true,
"data": "Tag deleted successfully"
}
Delete a tag.
GET /tag/search?name={name}
// Sample Response
{
"success": true,
"data": [
{
"id": 11,
"name": "matchingtag"
}
]
}
Search tags by name.
This section contains API requests related to confession views.
POST /view/{confessionId}
// Sample Response
{
"success": true,
"data": [
{
"id": 201207,
"confession_id": "6"
},
true
]
}
Create a view on a confession.
GET /view/{confessionId}
// Sample Response
{
"success": true,
"data": [
{
"id": 433,
"confession_id": 6
},
{
"id": 201207,
"confession_id": 6
}
]
}
Get views on a confession.
GET /view/count/{confessionId}
// Sample Response
{
"success": true,
"data": 139
}
Get total views on a confession.
GET /view/user/{userId}
// Sample Response
{
"success": true,
"data": [
{
"id": 422,
"confession_id": 263,
"user_id": 38
}
]
}
Get views by a user.
DELETE /view/{id}
// Sample Response
{
"success": true,
"data": "View deleted successfully"
}
Delete a view.
GET /view/user/confession/{confessionId}
// Sample Response
{
"success": true,
"data": {
"id": 200683,
"confession_id": 1331,
"user_id": 239
}
}
Check if logged in user has viewed a confession.
This section contains API requests related to analytics.
GET /analytics/growth-rate
// Sample Response
{
"success": true,
"data": {
"growthRate": [0, 1, 2, 3]
}
}
Get user growth rate for last 12 weeks.
GET /analytics/roles
// Sample Response
{
"success": true,
"data": [
{
"role": "admin",
"count": 5
},
{
"role": "user",
"count": 10
}
]
}
Get count of users by roles.
GET /analytics/verification
// Sample Response
{
"success": true,
"data": [
{
"is_verified": false,
"count": 20
},
{
"is_verified": true,
"count": 10
}
]
}
Get count of verified and unverified users.
GET /analytics/confession-approval
// Sample Response
{
"success": true,
"data": [
{
"is_approved": false,
"count": 10
},
{
"is_approved": true,
"count": 20
}
]
}
Get count of approved and pending confessions.
GET /analytics/up-down
// Sample Response
{
"success": true,
"data": {
"upVoteCount": [1,2,3],
"downVoteCount": [3,2,1]
}
}
Get upvote and downvote count over 12 weeks.
This section contains API request related to getting confession recommendations.
GET /recommendation
// Sample Response
{
"success": true,
"data": [
{
"id": 1298,
"title": "Recommended Confession"
},
{
"id": 945,
"title": "Another Recommended Confession"
}
]
}