this is a user api link
POST : api/users
{
"userId": "number",
"username": "string",
"password": "string",
"fullName": {
"firstName": "string",
"lastName": "string"
},
"age": "number",
"email": "string",
"isActive": "boolean",
"hobbies": [
"string",
"string"
],
"address": {
"street": "string",
"city": "string",
"country": "string"
}
}
GET : api/users
{
"success": true,
"message": "Users fetched successfully!",
"data": [
{
"username": "string",
"fullName": {
"firstName": "string",
"lastName": "string"
},
"age": "number",
"email": "string",
"address": {
"street": "string",
"city": "string",
"country": "string"
}
},
// more objects...
]
}
GET : api/user/:userid
- response data like this
{
"success": true,
"message": "User fetched successfully!",
"data": {
"userId": "number",
"username": "string",
"fullName": {
"firstName": "string",
"lastName": "string"
},
"age": "number",
"email": "string",
"isActive": "boolean",
"hobbies": [
"string",
"string"
],
"address": {
"street": "string",
"city": "string",
"country": "string"
}
}
}
PUT : /api/users/:userId
-
- and response this structure
{
"success": true,
"message": "User updated successfully!",
"data": {
"userId": "number",
"username": "string",
"fullName": {
"firstName": "string",
"lastName": "string"
},
"age": "number",
"email": "string",
"isActive": "boolean",
"hobbies": [
"string",
"string"
],
"address": {
"street": "string",
"city": "string",
"country": "string"
}
}
}
DELETE : /api/users/:userId
{
"success": true,
"message": "Users Deleted successfully!",
"data": {
"acknowledged": true,
"deletedCount": 1
}
}