🎯 Purpose for OutSystems Tutorial
This combined API is perfect for demonstrating **complex consumption requirements**. It forces users to set up two distinct types of inputs:
- Authentication: Passing the X-Api-Key via the **Request Headers**.
- Filtering/Input: Passing the id via the **URL Query Parameter**.
- Handling multiple failure scenarios (401, 400, 404) gracefully in OutSystems.
🔗 API Endpoint Details
Method:
GET
Endpoint URL Template:
https://api.ankitg.in/api/get-product-only.php?id={id}
Required Inputs:
| Parameter Name | Type | Location | Value/Example |
|---|---|---|---|
| id | Integer | Query String (URL) | e.g., 102 |
| X-Api-Key | Text | Header | ANKITG-TEST-12345 |
💬 Expected Responses
A. Success Response (200 OK) - All Inputs Correct
Returns a single Product JSON Object.
Example:
{
"id": 102,
"name": "API Integration Handbook",
"price": 29.50,
"inStock": true,
"category": "Book"
}
B. Failure Response (401 Unauthorized) - Missing Header
{
"error": "Unauthorized Access",
"message": "Missing or invalid 'X-Api-Key' header. Access denied."
}
C. Failure Response (404 Not Found) - Valid Key, Invalid ID
{
"error": "Resource not found",
"message": "Product with ID 999 was not found."
}