API 03: Get Product Only (Secure Detail)

Demonstrates a REST GET request requiring **BOTH** a URL Query Parameter and a custom Header for security.

🎯 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:

🔗 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."
}
            
▶️ Watch the Tutorial on Combining URL Params & Headers!