← Back to Sample APIs

Addition — Data as URL Parameters

Adds two integers passed as URL query parameters. No authentication required. Demonstrates the simplest way to send input data to a REST API.

Concept: URL Query Parameters · No Auth · JSON Response
Addition API Series — same operation, different style
01

Endpoint

GET https://labs.lowcademy.com/apis/add-url?input1=5&input2=3
PropertyValue
MethodGET
Fileadd-url.php
AuthenticationNone
Input styleURL query parameters
Output styleJSON body
02

Authentication

No authentication required — open endpoint.
03

Query Parameters

ParameterTypeRequiredDescription
input1IntegerRequiredFirst integer to add
input2IntegerRequiredSecond integer to add
04

Sample Requests

cURL

curl https://labs.lowcademy.com/apis/add-url?input1=5&input2=3

JavaScript (fetch)

const res  = await fetch('https://labs.lowcademy.com/apis/add-url?input1=5&input2=3');
const data = await res.json();
console.log(data.result); // 8

OutSystems — URL of the GET method

// Base URL: https://labs.lowcademy.com/apis/
// Method path: add-url.php
// Add Input Parameters: input1 (Integer), input2 (Integer)
// Both map to the query string automatically
05

Response — 200 OK

FieldTypeDescription
successBooleanAlways true on success
operationStringAlways "addition"
input1IntegerFirst number received
input2IntegerSecond number received
resultIntegerSum of input1 + input2
{
  "success"  : true,
  "operation": "addition",
  "input1"   : 5,
  "input2"   : 3,
  "result"   : 8
}
06

Error Responses

200
OK — Result returned.
400
Bad Request — Missing or non-numeric parameters.
405
Method Not Allowed — Use GET.