Addition — With Custom Header Auth
Adds two integers, but requires both an api_key and an api_secret sent as custom HTTP request headers. This is a pattern used by many production APIs (e.g. survey API in this lab).
| Property | Value |
|---|---|
| Method | GET |
| File | add-custom.php |
| Authentication | Custom headers: api_key + api_secret |
| Input style | URL query parameters |
Both headers must be present and match exactly. The server checks them before processing the request.
Lab Credentials — For Training Use Only
| Parameter | Type | Required | Description |
|---|---|---|---|
| input1 | Integer | Required | First integer to add |
| input2 | Integer | Required | Second integer to add |
cURL
curl -H "api_key: lc-api-key-2024" \ -H "api_secret: lc@Secret#2024" \ https://labs.lowcademy.com/apis/add-custom?input1=5&input2=3
JavaScript (fetch)
const res = await fetch('https://labs.lowcademy.com/apis/add-custom?input1=5&input2=3', { headers: { 'api_key' : 'lc-api-key-2024', 'api_secret': 'lc@Secret#2024' } });
OutSystems — Custom Headers
// In Consume REST API → On Before Request handler, add: // Request.Headers → Add("api_key", "lc-api-key-2024") // Request.Headers → Add("api_secret", "lc@Secret#2024")
{
"success" : true,
"auth_method": "Custom Header Auth (api_key + api_secret)",
"operation" : "addition",
"input1" : 5,
"input2" : 3,
"result" : 8
}api_key / api_secret headers.