This API provides functionalities for managing appointments efficiently, facilitating communication between admins and users. Below are the key routes and controllers along with example API responses:
Register a new admin.
Example:
Request:
{
"email": "[email protected]",
"name": "Admin Name",
"password": "admin123",
"shop": "My Shop"
}
Response:
{
"msg": "success",
"token": "jwt_token_here"
}
Admin login.
Example:
Request:
{
"email": "[email protected]",
"password": "admin123"
}
Response:
{
"msg": "success",
"token": "jwt_token_here"
}
Update admin's working slots.
Example:
Request:
{
"name": "My Shop",
"Object": {"Monday": "9AM-5PM", "Tuesday": "9AM-5PM", ...}
}
Response:
{
"msg": "Updated successfully"
}
Get appointments for a specific admin.
Example:
Response:
{
"app": [
{"user": "user_id_1", "service": "Service 1", ...},
{"user": "user_id_2", "service": "Service 2", ...},
...
]
}
Set appointment as completed.
Example:
Request:
{
"adminemail": "[email protected]",
"time": "14:00"
}
Response:
{
"msg": "Appointment marked as completed"
}
Get all appointments for a specific admin.
Example:
Response:
{
"appointments": [
{"user": "user_id_1", "service": "Service 1", ...},
{"user": "user_id_2", "service": "Service 2", ...},
...
]
}
Get specific working slots for an admin.
Example:
Response:
{
"slots": {"Monday": "9AM-5PM", "Tuesday": "9AM-5PM", ...}
}
Get a list of all shops.
Example:
Response:
{
"all": [
{"shopName": "Shop 1", ...},
{"shopName": "Shop 2", ...},
...
]
}
Get specific information about a shop.
Example:
Response:
{
"shop": "Shop Name",
"slots": {"Monday": "9AM-5PM", "Tuesday": "9AM-5PM", ...}
}
Register a new user.
Example:
Request:
{
"email": "[email protected]",
"name": "User Name",
"password": "user123"
}
Response:
{
"msg": "success",
"token": "jwt_token_here"
}
User login.
Example:
Request:
{
"email": "[email protected]",
"password": "user123"
}
Response:
{
"msg": "success",
"token": "jwt_token_here"
}
Get a list of all shops.
Example:
Response:
{
"all": [
{"shopName": "Shop 1", ...},
{"shopName": "Shop 2", ...},
...
]
}
Get specific information about a shop.
Example:
Response:
{
"shop": "Shop Name",
"slots": {"Monday": "9AM-5PM", "Tuesday": "9AM-5PM", ...}
}
Make a new appointment.
Example:
Request:
{
"userid": "user_id",
"name": "Shop Name",
"service": "Service Name",
"date": "2022-02-28",
"day": "Monday",
"time": "14:00",
"msg": "Additional Message",
"Object": {"custom_field_1": "value_1", "custom_field_2": "value_2"},
"useremail": "[email protected]"
}
Response:
{
"msg": "Appointment created successfully"
}
This documentation provides a comprehensive overview of the API routes and expected responses. Ensure that you handle errors and edge cases appropriately in your implementation.