Addition — Returns a Plain Integer
Adds two integers and returns just the number as plain text — no JSON wrapper. Content-Type: text/plain. Demonstrates that an API response doesn't have to be JSON.
| Property | Value |
|---|---|
| Method | GET |
| File | add-int.php |
| Authentication | None |
| Response Content-Type | text/plain |
| Response body | A single integer — e.g. 8 |
| Parameter | Type | Required | Description |
|---|---|---|---|
| input1 | Integer | Required | First integer |
| input2 | Integer | Required | Second integer |
8
{
"success": true,
"operation": "addition",
"input1": 5,
"input2": 3,
"result": 8
}In OutSystems, consuming a plain integer response is mapped differently — instead of deserialising a JSON structure you read the raw response body as text/integer. Most production APIs use JSON, but the integer style appears in legacy and embedded systems.
cURL
curl https://labs.lowcademy.com/apis/add-int?input1=5&input2=3 # Response: 8
JavaScript (fetch)
const res = await fetch('https://labs.lowcademy.com/apis/add-int?input1=5&input2=3'); const result = await res.text(); // NOT .json() — plain text! console.log(Number(result)); // 8
Error responses are also plain text (not JSON) to stay consistent with the Content-Type.
8