🎯 Purpose for OutSystems Tutorial
This API is the final REST CRUD operation and showcases a unique input method. It shows how to:
- Set the **REST Method** to DELETE.
- Pass an **Input Parameter** (the ID) to a custom **Request Header** in OutSystems.
- Handle the common success response for deletion (200 OK or 204 No Content).
🔗 API Endpoint Details
Method:
DELETE
Endpoint URL:
http://api.ankitg.in/api/delete-product.php
Required Header Parameter:
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| X-Product-ID | Integer | Header | The ID of the product to be deleted. |
💬 Expected Responses
A. Success Response (200 OK) - Item Deleted
Returns a confirmation message upon successful deletion.
{
"status": "Success",
"message": "Product ID 102 deleted successfully."
}
B. Failure Response (404 Not Found) - ID Not Found
{
"error": "Resource not found",
"message": "Product with ID 999 not found for deletion."
}
💡 Important for Tutorial Video!
To demonstrate the **impact** of this API call:- In OutSystems, **read the full list** of products using **GET** (API 1). Show product 102 exists.
- Call this **DELETE** API, passing ID 102 in the header.
- **Read the full list** again using **GET** (API 1). Show that product 102 is now permanently removed from the list (due to the session persistence).