- Method: Token Authentication
{
header: "Authorization": Token b872187981298702870812080 ,
}
Note that this authorization method will be used for most requests in this collection. Each endpoint will require authentication and some might require authorization in order to access them.
Accessing online:
https://glamourhaven.herokuapp.com/glamourhaven
or accessing on localhost
http://localhost:8000/glamourhaven
- URLs to access all the necessary API end-points
<str:pk>
is a variable name for the unique identifier of the object you are trying to accesses and in this case it is the primary key
This endpoint allows you add an employee. must be logged in to an account with a staff status...preferably the glamourhaven admin account
Request Type: POST
Endpoint: {baseUrl}/add-employee
Content-Type: application/json
Authorization: Token ${token}
How to update add an employee
{
"user": {
"email": "string",
"username": "string",
"password": "string"
},
"first_name": "string",
"last_name": "string",
"phone_number": "number",
"national_id": "number",
"profile_picture": "string",
"specialization": "string"
}
This endpoint allows you to list all current employees.
Request Type: GET
Endpoint: {baseUrl}/employees
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view a specific employee.
Request Type: GET
Endpoint: {baseUrl}/employees/{employee_id}
Params | Description | Required |
---|---|---|
employee_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update employee profile. must be logged in as the employee who owns the account
Request Type: PATCH
Endpoint: {baseUrl}/employees/{employee_id}/update-profile/
Params | Description | Required |
---|---|---|
employee_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
How to update employee profile
{
"user": {
"email": "string",
},
"phone_number": "number",
"profile_picture": "string",
}
This endpoint allows you to manage employee accounts. must be logged in as admin i.e an account with a staff status
Request Type: PUT/PATCH/DELETE
Endpoint: {baseUrl}/employees/{employee_id}/manage-employee/
Params | Description | Required |
---|---|---|
employee_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
How to manage an employee
{
"id": "number",
"profile_picture": "string",
"first_name": "string",
"last_name": "string",
"phone_number": "string",
"national_id": "string",
"specialization": "string"
}
This endpoint allows you to create a new client.
Request Type: POST
Endpoint: {baseUrl}/signup
Content-Type: application/json
How to manage an employee
{
"user": {
"email": "string",
"username": "string",
"password": "string"
},
"phone_number": "string",
"is_subscribed": "boolean",
"specialization": "string"
}
This endpoint allows you to list all clients.
Request Type: GET
Endpoint: {baseUrl}/clients
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view a specific client.
Request Type: GET
Endpoint: {baseUrl}/clients/{client_id}
Params | Description | Required |
---|---|---|
client_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update client profile. must be logged in as the account owner
Request Type: PUT/PATCH
Endpoint: {baseUrl}/client/{client_id}/update-profile
Params | Description | Required |
---|---|---|
client_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
How to manage an employee
{
"user": {
"username": "string",
"email": "string"
},
"phone_number": "string",
"is_subscribed": "boolean"
}
This endpoint allows you to update client profile. include the user id and the token as received from the email in the url as shown below
Request Type: POST
Endpoint: {baseUrl}/activate-account/{uid}/{token}/
Params | Description | Required |
---|---|---|
uid | string | yes |
token | string | yes |
Content-Type: application/json
How to manage an employee
{
"uid": "string",
"token": "boolean"
}
This endpoint allows you to update client profile. must be logged in as admin
Request Type: POST
Endpoint: {baseUrl}/add-commodity/
Content-Type: application/json
Authorization: Token ${token}
How to manage an employee
{
"commodity_name": "string",
"category": "string",
"description": "string",
"price": "number",
"pricing_unit": "number",
"number_in_stock": "number",
"commodity_main_image": "string",
"commodity_extra_image1": "string",
"commodity_extra_image2": "string"
}
This endpoint allows you to list all sale products in stock.
Request Type: GET
Endpoint: {baseUrl}/products/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view a specific commodity. must be logged in as admin
Request Type: GET
Endpoint: {baseUrl}/products/{product_id}/
Params | Description | Required |
---|---|---|
product_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update sale products. must be logged in as admin
Request Type: PUT/PATCH
Endpoint: {baseUrl}/commodity/{commodity_id}/update-commodity/
Params | Description | Required |
---|---|---|
commodity_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to add a new service. must be logged in as admin
Request Type: POST
Endpoint: {baseUrl}/add-service/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to add a new service.
Request Type: GET
Endpoint: {baseUrl}/services/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view a specific service. must be logged in as admin
Request Type: GET
Endpoint: {baseUrl}/services/{service_id}/
Params | Description | Required |
---|---|---|
service_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update a service. must be logged in as admin
Request Type: PUT/PATCH
Endpoint: {baseUrl}/services/{service_id}/update-service/
Params | Description | Required |
---|---|---|
service_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update a service. must be logged in as a client
Request Type: POST
Endpoint: {baseUrl}/book-appointment/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to list all booked appointments. must be logged in as admin or employee
Request Type: GET
Endpoint: {baseUrl}/appointments/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view a specific appointment. must be logged in as admin, employee or the client who booked the appointment
Request Type: GET
Endpoint: {baseUrl}/appointments/{appointment_id}
Params | Description | Required |
---|---|---|
appointment_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to update a specific appointment. must be logged in as admin, employee or the client who booked the appointment
Request Type: PUT/PATCH
Endpoint: {baseUrl}/appointments/{appointment_id}
Params | Description | Required |
---|---|---|
appointment_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to send an email to admin.
Request Type: PUT/PATCH
Endpoint: {baseUrl}/client-contact/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to acquire an expiring auth token (login).
Request Type: POST
Endpoint: {baseUrl}/login
Content-Type: application/json
This endpoint allows you to send an email to admin. must be logged in as a client
Request Type: POST
Endpoint: {baseUrl}/lnm-pay/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to submit an order. must be logged in as a client
Request Type: POST
Endpoint: {baseUrl}/submit-order/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to submit an order. must be logged in as admin
Request Type: GET
Endpoint: {baseUrl}/lnm-orders/
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to submit an order. must be logged in as admin or the client who placed that specific order
Request Type: GET
Endpoint: {baseUrl}/lnmorders/{order_id}/
Params | Description | Required |
---|---|---|
order_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view all of a specific client's orders. must be logged in as admin or the client who placed the orders
Request Type: GET
Endpoint: {baseUrl}/client-lnmorders/{client_id}/
Params | Description | Required |
---|---|---|
client_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}
This endpoint allows you to view all of a specific client's appointments. must be logged in as admin or the client who booked the appointments
Request Type: GET
Endpoint: {baseUrl}/client-appointments/{client_id}/
Params | Description | Required |
---|---|---|
client_id | string | yes |
Content-Type: application/json
Authorization: Token ${token}