Welcome to the Salon Marketplace API documentation. This API provides endpoints to manage various aspects of a salon marketplace, including user authentication, file management, category management, blog posts, services, reviews, workers, schedules, and appointments. Below, you'll find detailed information on how to use each of these endpoints.
- Authentication
- User Management
- File Management
- Category Management
- Blog Posts
- Services
- Reviews
- Workers
- Schedules
- Appointments
- Endpoint:
POST /auth/signup
- Description: Create a new user account.
- Request Body: User information.
- Required Roles: None
- Example:
POST /auth/signup
{
"username": "newuser",
"password": "password123",
"email": "[email protected]"
}
- Endpoint:
POST /auth/signin
- Description: Authenticate and log in a user.
- Request Body: User credentials.
- Required Roles: None
- Example:
POST /auth/signin
{
"username": "newuser",
"password": "password123"
}
- Endpoint:
POST /auth/refresh-token
- Description: Refresh the authentication token.
- Request Body: Refresh token.
- Required Roles: None
- Example:
POST /auth/refresh-token
{
"refreshToken": "your_refresh_token_here"
}
- Endpoint:
GET /user
- Description: Get a list of all users.
- Required Roles: Admin, Super Admin
- Example:
GET /user
- Endpoint:
GET /user/profile
- Description: Get the profile of the authenticated user.
- Required Roles: Admin, Customer, Super Admin, Worker
- Example:
GET /user/profile
- Endpoint:
GET /user/:id
- Description: Get the details of a specific user.
- Required Roles: Admin, Super Admin
- Example:
GET /user/1
- Endpoint:
PATCH /user/:id
- Description: Update user information.
- Required Roles: Admin, Customer, Super Admin, Worker
- Example:
PATCH /user/1
{
"email": "[email protected]"
}
- Endpoint:
DELETE /user/:id
- Description: Delete a user account.
- Required Roles: Admin, Super Admin, Customer
- Example:
DELETE /user/1
- Endpoint:
POST /file/upload
- Description: Upload a file.
- Request Body: File to be uploaded.
- Required Roles: Admin, Super Admin, Worker, Customer
- Example:
POST /file/upload
# Upload your file as part of the request body
- Endpoint:
GET /file
- Description: Get a list of all files.
- Required Roles: Admin, Super Admin, Worker, Customer
- Example:
GET /file
- Endpoint:
GET /category
- Description: Get a list of all categories.
- Required Roles: Admin, Super Admin
- Example:
GET /category
- Endpoint:
GET /category/:id
- Description: Get the details of a specific category.
- Required Roles: Admin, Super Admin
- Example:
GET /category/1
- Endpoint:
POST /category
- Description: Create a new category.
- Request Body: Category information.
- Required Roles: Admin, Super Admin
- Example:
POST /category
{
"name": "New Category",
"description": "Description of the new category"
}
- Endpoint:
PATCH /category/:id
- Description: Update category information.
- Required Roles: Admin, Super Admin
- Example:
PATCH /category/1
{
"name": "Updated Category Name"
}
- Endpoint:
DELETE /category/:id
- Description: Delete a category.
- Required Roles: Admin, Super Admin
- Example:
DELETE /category/1
- Endpoint:
POST /blog/create
- Description: Create a new blog post.
- Request Body: Blog post information.
- Required Roles: Admin, Super Admin, Worker, Customer
- Example:
POST /blog/create
{
"title": "New Blog Post",
"content": "Content of the new blog post."
}
- Endpoint:
GET /blog
- Description: Get a list of all blog posts.
- Required Roles: None
- Example:
GET /blog
- Endpoint:
GET /blog/service/:serviceID
- Description: Get blog posts related to a specific service.
- Required Roles: None
- Example:
GET /blog/service/1
- Endpoint:
GET /blog/:id
- Description: Get the details of a specific blog post.
- Required Roles: Admin, Super Admin
- Example:
GET /blog/1
- Endpoint:
PATCH /blog/:id
- Description: Update a blog post.
- Required Roles: Admin, Super Admin, Worker
- Example:
PATCH /blog/1
{
"content": "Updated content of the blog post."
}
- Endpoint:
DELETE /blog/:id
- Description: Delete a blog post.
- Required Roles: Admin, Super Admin, Worker
- Example:
DELETE /blog/1
- Endpoint:
POST /service/create
- Description: Create a new service.
- Request Body: Service information.
- Required Roles: Admin, Super Admin
- Example:
POST /service/create
{
"name": "New Service",
"categoryID": 1,
"description": "Description of the new service",
"price": 50.00
}
- Endpoint:
GET /service
- Description: Get a list of all services.
- Required Roles: None
- Example:
GET /service
- Endpoint:
GET /service/:categoryID/category
- Description: Get services within a specific category.
- Required Roles: None
- Example:
GET /service/1/category
- Endpoint:
GET /service/:id
- Description: Get the details of a specific service.
- Required Roles: None
- Example:
GET /service/1
- Endpoint:
PATCH /service/:id
- Description: Update service information.
- Required Roles: Admin, Super Admin
- Example:
PATCH /service/1
{
"price": 60.00
}
- Endpoint:
DELETE /service/:id
- Description: Delete a service.
- Required Roles: Admin, Super Admin
- Example:
DELETE /service/1
- Endpoint:
POST /review/create
- Description: Create a new review.
- Request Body: Review information.
- Required Roles: Admin, Super Admin, Customer
- Example:
POST /review/create
{
"serviceID": 1,
"rating": 4,
"comment": "Great service!"
}
- Endpoint:
GET /review
- Description: Get a list of all reviews.
- Required Roles: None
- Example:
GET /review
- Endpoint:
GET /review/:id
- Description: Get the details of a specific review.
- Required Roles: Admin, Super Admin, Customer
- Example:
GET /review/1
- Endpoint:
PATCH /review/:id
- Description: Update a review.
- Required Roles: Admin, Super Admin, Customer
- Example:
PATCH /review/1
{
"rating": 5,
"comment": "Exceptional service!"
}
- Endpoint:
DELETE /review/:id
- Description: Delete a review.
- Required Roles: Admin, Super Admin, Customer
- Example:
DELETE /review/1
- Endpoint:
POST /worker/create
- Description: Create a new worker profile.
- Request Body: Worker information.
- Required Roles: Admin, Super Admin, Worker
- Example:
POST /worker/create
{
"name": "John Doe",
"email": "[email protected]",
"description": "Experienced stylist"
}
- Endpoint:
GET /worker
- Description: Get a list of all workers.
- Required Roles: None
- Example:
GET /worker
- Endpoint:
GET /worker/:id
- Description: Get the details of a specific worker.
- Required Roles: None
- Example:
GET /worker/1
- Endpoint:
PATCH /worker/:id
- Description: Update worker information.
- Required Roles: Admin, Super Admin, Worker
- Example:
PATCH /worker/1
{
"description": "Experienced and highly skilled stylist"
}
- Endpoint:
DELETE /worker/:id
- Description: Delete a worker profile.
- Required Roles: Admin, Super Admin
- Example:
DELETE /worker/1
- Endpoint:
POST /schedule/create
- Description: Create a new schedule.
- Request Body: Schedule information.
- Required Roles: Super Admin, Admin
- Example:
POST /schedule/create
{
"workerID": 1,
"startDateTime": "2023-10-25T10:00:00",
"endDateTime": "2023-10-25T12:00:00"
}
- Endpoint:
GET /schedule
- Description: Get a list of all schedules.
- Required Roles: None
- Example:
GET /schedule
- Endpoint:
GET /schedule/:id
- Description: Get the details of a specific schedule.
- Required Roles: None
- Example:
GET /schedule/1
- Endpoint:
PATCH /schedule/:id
- Description: Update a schedule.
- Required Roles: Admin, Super Admin
- Example:
PATCH /schedule/1
{
"endDateTime": "2023-10-25T13:00:00"
}
- Endpoint:
DELETE /schedule/:id
- Description: Delete a schedule.
- Required Roles: Admin, Super Admin
- Example:
DELETE /schedule/1
- Endpoint:
POST /appointment/create
- Description: Create a new appointment.
- Request Body: Appointment information.
- Required Roles: Customer, Admin
- Example:
POST /appointment/create
{
"workerID": 1,
"serviceID": 1,
"startDateTime": "2023-10-25T11:00:00",
"endDateTime": "2023-10-25T11:30:00"
}
- Endpoint:
GET /appointment
- Description: Get a list of all appointments.
- Required Roles: Customer, Admin, Super Admin
- Example:
GET /appointment
- Endpoint:
GET /appointment/worker
- Description: Get appointments assigned to workers.
- Required Roles: Admin, Super Admin, Worker
- Example:
GET /appointment/worker
- Endpoint:
GET /appointment/:id
- Description: Get the details of a specific appointment.
- Required Roles: Customer, Admin, Super Admin, Worker
- Example:
GET /appointment/1
- Endpoint:
PATCH /appointment/:id
- Description: Update appointment information.
- Required Roles: Customer, Admin, Super Admin, Worker
- Example:
PATCH /appointment/1
{
"endDateTime": "2023-10-25T12:00:00"
}
- Endpoint:
DELETE /appointment/:id
- Description: Delete an appointment.
- Required Roles: Customer, Admin, Super Admin
- Example:
DELETE /appointment/1
This API documentation provides information on how to interact with the Salon Marketplace API. Each endpoint has specific requirements and functionalities, and it is essential to ensure you have the necessary roles and permissions when making requests. If you have any questions or need further assistance, please refer to the API's documentation or contact the API administrator.