-
Notifications
You must be signed in to change notification settings - Fork 8
API Endpoint
The website contains a variety of files pertaining to the API and how its utilized within the website
POST to addAdmin
This adds a new admin to the database
Requires
-
adminUsername- The username of the admin
-
adminPassowrd- The password of the admin
-
Token- Generated Token from the Admin Panel
Respones N/A
POST to addProduct
This adds a new product to the database
Requires
-
productName- The name of the product
-
productPrice- The price of the product
-
productStock- The amount of stock of the product
-
productDescription- The product description
-
productCategory- What category is the product in
-
Token- Generated Token from the Admin Panel
Response N/A
POST to addToken
This adds a new token to the database
Requires
-
tokenName- the name of the token
-
tokenAdmin- Which admin the token is associated with
-
tokenExp- The expiry date of the token
- `Token"
- Generated Token from the Admin Panel
Responses
-
418- "Invalid Token"
- "Error parsing token expiry date"
- "error creating token"
POST to cancelOrder
cancels a current order
Requires
-
orderID- The order ID
-
Token- Generated Token from the Admin Panel
Responses
-
418- "The Order ID is not specified"
- "Error cancelling order"
POST to deleteAdmin
Deletes an admin from the database
Requires
-
adminID- The id of the admin to be deleted
-
Token- Generated Token from the Admin Panel
Response
-
400- "Admin ID not specified"
- "echo
$message"
POST to deleteCustomer
Deletes a customer from the database
Requires
-
Token- Generated Token from the Admin Panel
-
customerID- The ID of the customer
Response
-
400- "Customer ID not specified"
- "echo
$message"
POST to deleteCustomerReviews
Deletes all reviews of a certain customer
Requires
-
Token- Generated Token from the Admin Panel
-
customerID- The ID of the customer
Responses
-
418- Customer ID not specified
- Error deleting reviews
POST TO deleteProduct
Deletes a product from the database
Requires
-
Token- Generated Token from the Admin Panel
-
productID- The ID of the product
Responses
-
400- Product ID not specified
- "echo $message"
POST to deleteProductReviews
Deletes all reviews from a certain product
Requires
-
Token- Generated Token from the Admin Panel
-
productID- The ID of the product
Responses
-
400- Product ID not specified
- Error deleting reviews