Base URL:
http://yourdomain.com/api/
/authors/insertAuthor.phpPOSTname: โJ.K. Rowlingโemail: โjk.rowling@example.comโ{ "message": "Author inserted successfully" }
/authors/readAuthors.phpGET[
{
"author_id": 1,
"name": "J.K. Rowling",
"email": "jk.rowling@example.com",
"created_at": "2024-12-31 10:00:00",
"updated_at": "2024-12-31 10:00:00"
}
]
/authors/getAuthorById.phpGETauthor_id (integer) - The ID of the author to retrieve.GET /authors/getAuthorById.php?author_id=1
{
"author_id": 1,
"name": "J.K. Rowling",
"email": "jk.rowling@example.com"
}
{ "message": "Author not found" }
{ "message": "Author ID is required" }
/authors/updateAuthor.phpPOSTauthor_id: 1name: โJ.K. Rowling Updatedโemail: โjk.new@example.comโ{ "message": "Author updated successfully" }
/authors/deleteAuthor.phpPOSTauthor_id: 1{ "message": "Author deleted successfully" }
/books/insertBook.phpPOSTtitle: โHarry Potterโprice: 20.99stock_qty: 10author_id: 1{ "message": "Book inserted successfully" }
/books/readBooks.phpGET[
{
"book_id": 1,
"title": "Harry Potter",
"price": 20.99,
"stock_quantity": 10,
"author_id": 1
}
]
/books/getBookById.phpGETbook_id (integer) - The ID of the book to retrieve.GET /books/getBookById.php?book_id=1
{
"book_id": 1,
"title": "Harry Potter",
"price": 20.99,
"stock_quantity": 10,
"author_id": 1
}
{ "message": "Book not found" }
{ "message": "Book ID is required" }
/books/updateBook.phpPOSTbook_id: 1title: โHarry Potter Updatedโprice: 22.99stock_qty: 15author_id: 1{ "message": "Book updated successfully" }
/books/deleteBook.phpPOSTbook_id: 1{ "message": "Book deleted successfully" }
/orders/insertOrder.phpPOST{
"customer_id": 1,
"order_details": [
{
"book_id": 5,
"quantity": 2,
"line_total": 40.00
},
{
"book_id": 7,
"quantity": 1,
"line_total": 25.00
}
]
}
{ "message": "Order created successfully", "order_id": 12 }
{ "message": "Customer ID and order details are required" }
{ "message": "Invalid JSON format" }
/orders/readOrders.phpGET[
{
"order_id": 1,
"customer_id": 3,
"order_date": "2024-12-31 10:03:00",
"total_amount": "55.00",
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"order_details": [
{
"order_details_id": 5,
"book_id": 2,
"quantity": 1,
"line_total": "25.00",
"book_title": "The Great Gatsby",
"price": "25.00"
},
{
"order_details_id": 6,
"book_id": 3,
"quantity": 2,
"line_total": "30.00",
"book_title": "1984",
"price": "15.00"
}
]
}
]
/orders/getOrderById.phpGETorder_id (integer) - The ID of the order to retrieve.GET /orders/getOrderById.php?order_id=1
{
"order_id": 1,
"customer_id": 3,
"order_date": "2024-12-31 10:03:00",
"total_amount": "55.00",
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"order_details": [
{
"order_details_id": 5,
"book_id": 2,
"quantity": 1,
"line_total": "25.00",
"book_title": "The Great Gatsby",
"price": "25.00"
},
{
"order_details_id": 6,
"book_id": 3,
"quantity": 2,
"line_total": "30.00",
"book_title": "1984",
"price": "15.00"
}
]
}
{ "message": "Order not found" }
{ "message": "Order ID is required" }
/orders/deleteOrder.phpPOSTorder_id: 1{ "message": "Order deleted successfully" }
/reports/summaryReport.phpGET{
"total_books": 120,
"total_customers": 45,
"total_orders": 350,
"total_order_value": "15000.00",
"todays_orders": 5,
"todays_order_value": "700.00",
"monthly_orders": 30,
"monthly_order_value": "4500.00"
}
{ "message": "No data available" }