API Documentation
1) Home Page
• API Url: [Link]
• method: get
• response: 200
Plaintext
"hello to home page"
2) Fetch all users
• API Url: [Link]
• method: get
• response: 200
JSON:
[
{
"id": 1,
"name": "Munish",
"branch": "CSE"
},
{
"id": 2,
"name": "Jagadeesh",
"branch": "ECE"
},
{
"id": 3,
"name": "Nazeer",
"branch": "cse"
},
{
"id": 4,
"name": "Haswanth",
"branch": "IT"
}
]
3) Fetch user by Id
• API Url: [Link]
• Ex: [Link]
• method: GET
• response: 200 (Success) / 404 (Not Found)
Success Response (200):
JSON
{
"id": 1,
"name": "Munish",
"branch": "CSE"
}
Error Response (404):
Plaintext
"user not found"
4) Add a user
•API Url: [Link]
• method: post
• response: 201
Request Body (JSON):
JSON
{
"id": 5,
"name": "ARUN",
"branch": "EEE"
}
Response Body (Plaintext):
"user added successfully"
5) Update a user
• API Url: [Link]
• Ex: [Link]
• method: PUT
• response: 201 (Success) / 404 (Not Found)
Request Body (JSON):
JSON
{
"id": 1,
"name": "Akash",
"branch": "CSE"
}
Success Response (201):
Plaintext
"user updated successfully"
Error Response (404):
Plaintext
"user not found"
6) Delete a user by Id
• API Url: [Link]
Ex: [Link]
• method: delete
• response: 200 (Success) / 404 (Not Found)
Success Response (200):
Plaintext
"User deleted successfully"
Error Response (404):
Plaintext
"User Not Found"