API 04: Secure Product List (Basic Auth)

Demonstration of a REST GET request requiring **Basic HTTP Authentication**.

🎯 Purpose for OutSystems Tutorial

This API is essential for teaching **Basic Authentication** consumption. It shows how to:

🔗 API Endpoint Details

Method:

GET

Endpoint URL:

https://api.ankitg.in/api/auth-products.php

🔑 Required Credentials

Parameter Value
Username ankitg
Password lowcode123

💬 Expected Responses

A. Success Response (200 OK) - Correct Credentials

Returns the product list when the correct credentials are provided via Basic Auth.

[
    {
        "id": 101,
        "name": "OutSystems Pro Course",
        "price": 499.99,
        "inStock": true
    },
    // ... remaining products
]
            

B. Failure Response (401 Unauthorized) - Incorrect Credentials

Returns a generic error if the username or password is incorrect or missing.

{
    "error": "Unauthorized",
    "message": "Invalid credentials provided."
}
            
▶️ Watch the Tutorial on Consuming APIs with Basic Authentication!