List of Available Endpoints:
PATCH /admins/update-password
✔GET /users
✔PATCH /users/:id/suspend
❌PATCH /posts/:id/archive
❌GET /reports
❌GET /adminlogs
❌POST /categories
❌PATCH /categories/:id
❌
PATCH /users/update-password
✔PUT /users/:id
❌POST /posts
❌PUT /posts/:id
❌PATCH /posts/:id
❌GET /notifications
❌GET /chats
❌POST /chats
❌GET /messages
❌POST /messages
❌POST /comments
❌POST /reports
❌
POST /admins/login
✔POST /admins/register
✔POST /users/login
✔POST /users/login/google
❌POST /users/register
✔GET /public/users/:id
✔GET /public/posts
❌GET /public/posts/:id
❌GET /public/posts/nearby
❌GET /public/categories
❌GET /public/categories/:id
❌
- Verify an user then give jwt_token
- Body
{ "username": < username: String > || < email: String >, "password": String }
200 - OK
- Body
{ "access_token": String, "id": UUID, "username": String, "email": String }
400 - Bad Request
- Body
{ "message": "Input is required" }
401 - Unauthorized
- Body
{ "message": "Unauthorized" }
- Create new user account
- Body
{ "username": String, "email": String, "password": String, "city": String }
201 - Created
- Body
{ "message": String }
400 - Bad Request
- Body
{ "message": < sequelize_validation_error: String > }
409 - Conflict
- Body
{ "message": < sequelize_validation_error: String > }
- Update an existing user password
- Headers
{ "access_token": < user_jwt_token: String > }
- Body
{ "newpassword": String, "oldpassword": String }
200 - OK
- Body
{ "message": String }
400 - Bad Request
- Body
{ "message": < sequelize_validation_error: String > }
401 - Unauthorized
- Body
{ "message": "Unauthorized" }
404 - NotFound
- Body
{ "message": String }
- Verify an admin then give jwt_token
- Body
{ "username": < username: String > || < email: String >, "password": String }
200 - OK
- Body
{ "access_token": String, "id": UUID, "username": String, "email": String }
400 - Bad Request
- Body
{ "message": "Input is required" }
401 - Unauthorized
- Body
{ "message": "Unauthorized" }
- Create new admin account
- Headers
{ "access_token": < admin_jwt_token: String > }
- Body
{ "username": String, "email": String, "password": String }
201 - Created
- Body
{ "message": String }
400 - Bad Request
- Body
{ "message": < sequelize_validation_error: String > }
409 - Conflict
- Body
{ "message": < sequelize_validation_error: String > }
- Update an existing admin password
- Headers
{ "access_token": < admin_jwt_token: String > }
- Body
{ "newpassword": String, "oldpassword": String }
200 - OK
- Body
{ "message": String }
400 - Bad Request
- Body
{ "message": < sequelize_validation_error: String > }
401 - Unauthorized
- Body
{ "message": "Unauthorized" }
404 - NotFound
- Body
{ "message": String }
- Get all users
- Headers
{ "access_token": < admin_jwt_token: String > }
200 - OK
- Body
[ { "id": UUID, "email": String, "username": String, "profileImg": String, "name": String, "notes": String, "phoneNumber": String, "status": Enum(["unverified", "verified", "suspend", "premium"]), "city": String, "ratings": Integer, "warningCount": Integer, "createdAt": Date, "updatedAt": Date }, ... ]
- Get an user profile data based on given id
200 - OK
-
Body
[ { "id": UUID, "email": String, "username": String, "profileImg": String, "name": String, "notes": String, "phoneNumber": String, "status": Enum(["unverified", "verified", "suspend", "premium"]), "city": String, "ratings": Integer, "createdAt": Date, "updatedAt": Date, "Posts": [ { "id": UUID, "title": String, "condition": Enum(["brand new", "like new", "lightly used", "well used", "heavily used"]), "status": Enum(["active", "inactive", "complete", "suspend"]), "images": [ String ], "price": Integer, "createdAt": Date, "updatedAt": Date, "Category": { "id": UUID, "name": String } }, ... ], "Reviews": [ { "id": UUID, "message": String, "createdAt": Date, "updatedAt": Date, "Sender": { "id": UUID, "username": String, "profileImg": String } }, ... ] }, ... ]
401 - Unauthorized
- Body
{ "message": "Unauthorized" }
403 - Forbidden
- Body
{ "message": "Forbidden access" }
500 - Internal Server Error
- Body
{ "message": "Internal Server Error" }