https://monitoring.xampah.com/api

API Documentation

Biogas Monitoring & Waste Management System — Depok · Jatisari · Indramayu · JakBar

Base URL
https://monitoring.xampah.com/api

How to Use This API

Complete integration guide for the RMC API

Authentication

Every data endpoint (GET) needs an X-API-KEY with the read scope, or an Authorization: Bearer token from POST /login. Only /ping and /test-cors are public.

Base URL

Every endpoint is relative to: https://monitoring.xampah.com/api/

Login Rate Limit

POST /login: at most 10 attempts per minute per IP (then 429).

Access per Endpoint

Every endpoint below carries an access label. Labels are read straight from the server's own rules, so they always match what is actually enforced.

Label How to access
Public No authentication.
API key (read) / login X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.
Device API key X-API-KEY header (scope * — read-only keys are refused with 403).
Authorization: Bearer token from POST /login.
Getting an API Key
Keys are issued by the system administrator: ask for a read key for dashboards and integrations, or a device key for hardware that sends data. A key is for servers / devices only, never for browser code: anyone can read a key from browser JavaScript. Browser apps log in with POST /login and use the Bearer token.
Headers
Accept: application/json (always; validation errors come back as JSON 422)
Content-Type: application/json (POST/PUT with a JSON body)
X-API-KEY: sk_... (servers/devices)  or  Authorization: Bearer {token} (login)
Response Format
{
  "success": true,           // true on success
  "message": "...",          // message (optional)
  "data": {},                // payload (object or array)
  "pagination": {            // on paginated endpoints (called "meta" on some)
    "current_page": 1,
    "per_page": 25,
    "total": 100,
    "last_page": 4
  }
}
Status Codes
HTTP Meaning Notes
200OKSuccess
201CreatedData created
401UnauthorizedMissing / wrong X-API-KEY or login token
403ForbiddenValid credentials but not allowed (e.g. a read-only key sending data, not an admin)
404Not FoundData or endpoint does not exist
409ConflictDuplicate data (e.g. the same truck within 1 minute)
422Unprocessable EntityValidation failed; details in errors
429Too Many RequestsToo many login attempts / repeated card tap
500Server ErrorServer error
Login Flow (browser apps)
1. Login
curl -X POST https://monitoring.xampah.com/api/login \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "your_password"}'

# response:
# {"success": true, "data": {"user": {...}, "token": "12|xxxx", "token_type": "Bearer"}}
2. Use the token to read data
curl https://monitoring.xampah.com/api/getCustomer \
  -H "Accept: application/json" \
  -H "Authorization: Bearer 12|xxxx"

# Swap the token:  POST /refresh   (Bearer)
# Sign out:        POST /logout    (Bearer)
Example Workflows

Scavenger Workflow

1 Register card: POST /register-card-member
2 Record attendance: POST /attendance
3 Save waste weight: POST /scavengers/save-mlo
4 View rankings: GET /scavengers/users
5 Get total weight: GET /scavengers/total-weight

Biogas Monitoring

1 Push Depok data: POST /biogas
2 Push Jatisari data: POST /biogas/jatisari/push
3 Push Indramayu data: POST /biogas/indramayu/push
4 Get latest: GET /biogas-data/latest
5 View stats: GET /biogas-data/stats

Vehicle Weight

1 Record entry: POST /weightDataIn
2 Record exit: POST /weightDataOut
3 Get history: GET /weight/data
4 Recap & MLO: GET /recap/waste
Code Examples
PHP - cURL
<?php
// PHP cURL example - save an MLO weight
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL            => 'https://monitoring.xampah.com/api/scavengers/save-mlo',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
        'X-API-KEY: sk_xxxxxxxxxxxxxxxxxxxxxxxxx',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'user_id' => 1,
        'weight'  => 5.5,
    ]),
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo curl_error($ch);
}

curl_close($ch);
echo $response;
JavaScript - Fetch API
// JavaScript Fetch example
async function saveMlo(userId, weight) {
    const response = await fetch(
        'https://monitoring.xampah.com/api/scavengers/save-mlo',
        {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                'X-API-KEY': 'sk_xxxxxxxxxxxxxxxxxxxxxxxxx',
            },
            body: JSON.stringify({ user_id: userId, weight }),
        }
    );

    const data = await response.json();
    console.log(data);
}

saveMlo(1, 5.5);
Python - Requests
# Python Requests example
import requests

url     = "https://monitoring.xampah.com/api/scavengers/save-mlo"
headers = {
    "Content-Type": "application/json",
    "X-API-KEY":    "sk_xxxxxxxxxxxxxxxxxxxxxxxxx",
}
data = {"user_id": 1, "weight": 5.5}

response = requests.post(url, json=data, headers=headers, timeout=10)

print("Status:", response.status_code)
print(response.json())

General API Endpoints

Authentication, API keys, users & roles, sensor health & history for every location, and Fleet (OTA / MQTT) for every gateway

Server Status
GET
/ping
Check the server is up (public, no data)
Public Test

Access: No authentication.

bash
curl "https://monitoring.xampah.com/api/ping" \
  -H "Accept: application/json"
json
{"status": "ok", "time": "2026-10-01 15:40:00"}
GET
/test-cors
Check CORS from a browser (public, no data)
Public Test

Access: No authentication.

bash
curl "https://monitoring.xampah.com/api/test-cors" \
  -H "Accept: application/json"
GET
/db-test
Check the database connection
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/db-test" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"status": "success"}
Admin Dashboard Login (Sanctum)
POST
/login
Log in an admin dashboard user; the token is used as Authorization: Bearer
Public

Access: No authentication.

username may hold a username or an email. Logging in deletes that user's old tokens (other devices are signed out). Admin/superadmin accounts with check_session=true: if the account is still active on another device (used in the last 30 minutes) the answer is 409 {code: session_active, data: {device, last_activity}}; send again with force=true to sign that device out. At most 10 attempts per minute per IP (429).

Parameter Type Required Description
username string required Username or email
password string required Password
check_session boolean optional Admin panel: ask first when the account is active on another device
force boolean optional Log in anyway and sign the other device out
bash
curl -X POST "https://monitoring.xampah.com/api/login" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "••••••••"}'
json
{"username": "admin", "password": "••••••••"}
json
{"success": true, "message": "Login successful", "data": {"user": {"id": 1, "name": "Admin", "username": "admin", "email": "..."}, "token": "12|xxxxxxxx", "token_type": "Bearer"}}
GET
/user
The logged-in user

Access: Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/user" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <token from POST /login>"
POST
/refresh
Swap the token for a new one

Access: Authorization: Bearer token from POST /login.

bash
curl -X POST "https://monitoring.xampah.com/api/refresh" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <token from POST /login>"
POST
/logout
Revoke the token in use

Access: Authorization: Bearer token from POST /login.

bash
curl -X POST "https://monitoring.xampah.com/api/logout" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <token from POST /login>"
json
{"success": true, "message": "Logout successful"}
Users & Roles
GET
/roles
List roles + user count
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/roles" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/roles/{id}
One role with its users
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required Role ID
bash
curl "https://monitoring.xampah.com/api/roles/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/users
List users (paginated, searchable)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
search string optional Name/username/email
role string optional Role name
role_id integer optional Role ID
page integer optional Page
per_page integer optional Rows per page (max 200)
bash
curl "https://monitoring.xampah.com/api/users?role=admin&per_page=50" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/users/stats
User count per role
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/users/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/users/by-role/{role}
Users with a given role
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
role string (path) required Role name
bash
curl "https://monitoring.xampah.com/api/users/by-role/{role}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/users/{id}
User detail (with role and their API keys, without the key values)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required User ID
bash
curl "https://monitoring.xampah.com/api/users/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Sensor Health & History (All Locations)
GET
/history/{source}
Sensor history over a date range: average per time bucket + exact statistics (min/avg/max/latest)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

source: depok-biogas, depok-incinerator-1, depok-incinerator-2, indramayu-biogas, jatisari-biogas. The bucket width follows the length of the range: ≤1 day 5 minutes, ≤3 days 15 minutes, ≤14 days 1 hour, ≤62 days 6 hours, longer 1 day. Maximum range 366 days. t = start of the bucket (WIB).

Parameter Type Required Description
source string (path) required Data source (see notes)
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive)
fields string optional Comma-separated columns, e.g. ph_1,ph_2; default every column of the source
bash
curl "https://monitoring.xampah.com/api/history/{source}?start_date=2026-09-24&end_date=2026-09-30&fields=Tmp_Icn,Tmp_Prl" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{
  "success": true, "source": "depok-incinerator-1", "label": "Incinerator 1",
  "start_date": "2026-09-24", "end_date": "2026-09-30", "bucket_seconds": 3600,
  "fields": [{"key": "Tmp_Icn", "label": "Tmp_Icn", "unit": "°C"}],
  "stats": {"Tmp_Icn": {"current": 678, "minimum": 40, "average": 388.12, "maximum": 769}},
  "count": 168,
  "points": [{"t": "2026-09-24 00:00:00", "n": 6, "Tmp_Icn": 151.5}]
}

Depok API Endpoints

Biogas, incinerator temperatures, truck scale, sorting scale (scavengers), waste & MLO recap, RFID cards, attendance

Biogas
POST
/biogas
Send one hourly biogas reading from the ESP32 gateway (esp_depok_2025)
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Form-urlencoded or JSON. Send Accept: application/json so validation errors come back as 422 JSON. Balloon_1..4 = fill level (%), 0 means no reading.

Parameter Type Required Description
ph_1 number required Reactor 1 pH
ph_2 number required Reactor 2 pH
ph_3 number required Reactor 3 pH
ph_4 number required Reactor 4 pH
ph_5 number required Reactor 5 pH
ph_6 number required Reactor 6 pH
ph_7 number required Reactor 7 pH
gas_value_1 number required Gas meter 1 (m³)
pressureGas_1 number required Gas pressure 1 (kPa)
temperatureGas_1 number required Gas temperature 1 (°C)
gas_value_2 number required Gas meter 2 (m³)
pressureGas_2 number required Gas pressure 2 (kPa)
temperatureGas_2 number required Gas temperature 2 (°C)
Balloon_1 number required Balloon 1 level (%)
Balloon_2 number required Balloon 2 level (%)
Balloon_3 number required Balloon 3 level (%)
Balloon_4 number required Balloon 4 level (%)
bash
curl -X POST "https://monitoring.xampah.com/api/biogas" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"ph_1":7.12,"ph_2":7.05,"ph_3":6.98,"ph_4":7.20,"ph_5":7.01,"ph_6":6.95,"ph_7":7.10, "gas_value_1":85.5,"pressureGas_1":2.1,"temperatureGas_1":35.2, "gas_value_2":42.3,"pressureGas_2":1.9,"temperatureGas_2":34.8, "Balloon_1":61.05,"Balloon_2":58.42,"Balloon_3":0,"Balloon_4":72.63}'
json
{"ph_1":7.12,"ph_2":7.05,"ph_3":6.98,"ph_4":7.20,"ph_5":7.01,"ph_6":6.95,"ph_7":7.10,
 "gas_value_1":85.5,"pressureGas_1":2.1,"temperatureGas_1":35.2,
 "gas_value_2":42.3,"pressureGas_2":1.9,"temperatureGas_2":34.8,
 "Balloon_1":61.05,"Balloon_2":58.42,"Balloon_3":0,"Balloon_4":72.63}
json
{"success": true}
GET
/biogas-data
Latest biogas data (list, not paginated)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/biogas-data" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas-data/latest
The single newest biogas reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/biogas-data/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success": true, "data": {"id": 20512345, "ph_1": 7.2, "gas_value_1": 85.5, "Balloon_1": 61.05, "created_at": "2026-10-01T08:00:00.000000Z"}}
GET
/biogas-data/paginated
Biogas history by page, newest first
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
page integer optional (default: 1) Page
per_page integer optional (default: 15) Rows per page (max 100)
bash
curl "https://monitoring.xampah.com/api/biogas-data/paginated?page=1&per_page=50" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas-data/date-range
Biogas data within a date range
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
limit integer optional Max rows
bash
curl "https://monitoring.xampah.com/api/biogas-data/date-range?start_date=2026-09-01&end_date=2026-09-30" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas-data/stats
Biogas statistics summary
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/biogas-data/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas-data/{id}
One biogas reading by id
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required biogas_data row ID
bash
curl "https://monitoring.xampah.com/api/biogas-data/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Incinerator & Pyrolysis Temperatures
POST
/tempMonitor
Send Incinerator 1 temperatures (Tmp_Icn, Tmp_Dct, Tmp_Prl) from the ICN controller
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
Tmp_Icn number required Incinerator temperature (°C)
Tmp_Dct number required ICN-2 / ducting temperature (°C)
Tmp_Prl number required Chamber/pyrolysis temperature (°C)
bash
curl -X POST "https://monitoring.xampah.com/api/tempMonitor" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"Tmp_Icn": 712, "Tmp_Dct": 655, "Tmp_Prl": 680}'
json
{"Tmp_Icn": 712, "Tmp_Dct": 655, "Tmp_Prl": 680}
json
{"Success": true}
POST
/tempMonitor2
Send Incinerator 2 temperatures (7 columns) from the ICN-2 monitor (firmware Temperature-Monitoring-ICN-2-, needs X-API-KEY; Tmp_IcnJ1/Tmp_DctJ1 are sent as 0, a faulty sensor is sent as 0)
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
Tmp_IcnJ1 number required ICN (°C)
Tmp_DctJ1 number required Ducting (°C)
Tmp_CmbJ1 number required Chamber 1 (°C)
Tmp_PrlJ1_1 number required Pyrolysis 1 (°C)
Tmp_PrlJ1_2 number required Pyrolysis 2 (°C)
Tmp_PrlJ1_3 number required Pyrolysis 3 (°C)
Tmp_PrlJ1_4 number required Pyrolysis 4 (°C)
bash
curl -X POST "https://monitoring.xampah.com/api/tempMonitor2" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"Tmp_IcnJ1":720,"Tmp_DctJ1":640,"Tmp_CmbJ1":690,"Tmp_PrlJ1_1":410,"Tmp_PrlJ1_2":398,"Tmp_PrlJ1_3":380,"Tmp_PrlJ1_4":372}'
json
{"Tmp_IcnJ1":720,"Tmp_DctJ1":640,"Tmp_CmbJ1":690,"Tmp_PrlJ1_1":410,"Tmp_PrlJ1_2":398,"Tmp_PrlJ1_3":380,"Tmp_PrlJ1_4":372}
json
{"success": true, "data": {"id": 10512345, "Tmp_IcnJ1": 720, ...}}
GET
/temp-data
Incinerator 1 temperatures: realtime (range) or all data in a date range (start_date & end_date, paginated)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Without start_date/end_date: the latest data by range, at most limit rows. With start_date & end_date: EVERY reading in that range, newest first, paginated; meta holds total & last_page. Maximum range 366 days.

Parameter Type Required Description
range today|week|month optional (default: today) Realtime mode
limit integer optional (default: 500) Realtime mode: max rows (max 1000)
start_date date (Y-m-d) optional Range mode: start date
end_date date (Y-m-d) optional Range mode: end date
page integer optional (default: 1) Range mode: page
per_page integer optional (default: 100) Range mode: rows per page (max 500)
bash
curl "https://monitoring.xampah.com/api/temp-data?start_date=2026-09-25&end_date=2026-10-01&page=1&per_page=100" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success": true, "data": [{"id": 20500123, "Tmp_Icn": 678, "Tmp_Dct": 658, "Tmp_Prl": 671, "created_at": "..."}], "meta": {"page": 1, "per_page": 100, "total": 959, "last_page": 10}}
GET
/temp-data/latest
The newest Incinerator 1 reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/temp-data/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/temp-data/{id}
An Incinerator 1 reading by id
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required temp_monitors row ID
bash
curl "https://monitoring.xampah.com/api/temp-data/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/temp2-data
Incinerator 2 temperatures: realtime or a date range (same as /temp-data)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
range today|week|month optional (default: today) Realtime mode
limit integer optional (default: 500) Realtime mode: max rows (max 1000)
start_date date (Y-m-d) optional Range mode: start date
end_date date (Y-m-d) optional Range mode: end date
page integer optional (default: 1) Range mode: page
per_page integer optional (default: 100) Range mode: rows per page (max 500)
bash
curl "https://monitoring.xampah.com/api/temp2-data?range=today" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/temp2-data/range
Incinerator 2 within a date range (older version, at most limit rows)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
limit integer optional (default: 1000) Max rows (max 5000)
bash
curl "https://monitoring.xampah.com/api/temp2-data/range?start_date=2026-09-01&end_date=2026-09-07" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/temp2-data/latest
The newest Incinerator 2 reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/temp2-data/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/temp2-data/{id}
An Incinerator 2 reading by id
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required temp_monitor2 row ID
bash
curl "https://monitoring.xampah.com/api/temp2-data/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Truck Scale (Incoming Waste)
GET
/weight/data
Truck transactions + summary (daily target, per hour, 30-day trend, top customers) for one day/week/month/year or a range
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

period + date pick the period around that date. today_stats (target, total, per hour) and the 30-day trend follow the chosen date.

Parameter Type Required Description
period daily|weekly|monthly|yearly|custom optional (default: daily) Period
date date (Y-m-d) optional (default: today) Reference date
start_date date optional Custom range: start (required together with end_date)
end_date date optional Custom range: end
limit integer optional (default: 100) Transactions per page (max 1000)
page integer optional (default: 1) Page
driver_id integer optional Filter by driver
customer_id integer optional Filter by customer
no_order string optional Search order no.
is_completed boolean optional true = already weighed out, false = not yet
min_net_weight number optional Minimum net weight
max_net_weight number optional Maximum net weight
sort_by created_at|time_in|time_out|weight_in|weight_out optional (default: created_at) Sort by
sort_direction asc|desc optional (default: desc) Direction
target_daily_tons number optional (default: 10) Daily target (tons)
use_cache boolean optional (default: true) Use the 30 s cache
bash
curl "https://monitoring.xampah.com/api/weight/data?period=daily&date=2026-09-30&limit=1000" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/getCustomer
List every customer (customers)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/getCustomer" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Sorting Scale (Scavengers)
GET
/scavengers/users
Sorting staff + weight ranking for one day
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
date date (Y-m-d) optional (default: today) Date
bash
curl "https://monitoring.xampah.com/api/scavengers/users?date=2026-09-30" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavengers/users/{user_id}
Weighing details of one sorting staff member
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
user_id integer (path) required Staff ID
date date (Y-m-d) optional (default: today) Date
page integer optional Page
limit integer optional Rows per page
bash
curl "https://monitoring.xampah.com/api/scavengers/users/{user_id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavengers/user/{id}
Name & email of one user
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required users.id
bash
curl "https://monitoring.xampah.com/api/scavengers/user/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavengers/weight
The last 10 sorting weighings
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/scavengers/weight" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavengers/total-weight
Total weight per waste type for one day
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
date date (Y-m-d) optional (default: today) Date
user_id integer optional Only this staff member
bash
curl "https://monitoring.xampah.com/api/scavengers/total-weight" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavengers/total-weight-range
Total weight per waste type over a date range
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
user_id integer optional Only this staff member
bash
curl "https://monitoring.xampah.com/api/scavengers/total-weight-range?start_date=2026-09-01&end_date=2026-09-30" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
POST
/scavengers/save-mlo
Save the MLO (organic) weight (column mlo) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-mlo" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'mlo' berhasil disimpan."}
POST
/scavengers/save-plastic
Save the plastic weight (column plastic) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-plastic" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'plastic' berhasil disimpan."}
POST
/scavengers/save-gabruk
Save the gabruk (mixed waste) weight (column gabruk) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gabruk" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gabruk' berhasil disimpan."}
POST
/scavengers/save-botol-plastik
Save the plastic bottle weight (column botol_plastik) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-botol-plastik" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'botol_plastik' berhasil disimpan."}
POST
/scavengers/save-kertas
Save the paper weight (column kertas) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-kertas" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'kertas' berhasil disimpan."}
POST
/scavengers/save-kardus
Save the cardboard weight (column kardus) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-kardus" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'kardus' berhasil disimpan."}
POST
/scavengers/save-botol-kaca
Save the glass bottle weight (column botol_kaca) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-botol-kaca" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'botol_kaca' berhasil disimpan."}
POST
/scavengers/save-aqua-gelas
Save the plastic cup (aqua gelas) weight (column aqua_gelas) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-aqua-gelas" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'aqua_gelas' berhasil disimpan."}
POST
/scavengers/save-incenerator
Save the incinerator 1 feedstock weight (column incenerator) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-incenerator" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'incenerator' berhasil disimpan."}
POST
/scavengers/save-incenerator2
Save the incinerator 2 feedstock weight (column incenerator_2) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-incenerator2" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'incenerator_2' berhasil disimpan."}
POST
/scavengers/save-pirolisis
Save the pyrolysis weight (column pirolisis) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-pirolisis" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'pirolisis' berhasil disimpan."}
POST
/scavengers/save-pirolisis2
Save the pyrolysis 2 weight (column pirolisis_2) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-pirolisis2" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'pirolisis_2' berhasil disimpan."}
POST
/scavengers/save-bahan-prl
Save the pyrolysis feedstock weight (column bahan_pirolisis) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-bahan-prl" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'bahan_pirolisis' berhasil disimpan."}
POST
/scavengers/save-icn-today
Save the ready-to-burn weight (column siap_bakar) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-icn-today" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'siap_bakar' berhasil disimpan."}
POST
/scavengers/save-botol-biru
Save the blue bottle weight (column botol_biru) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-botol-biru" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'botol_biru' berhasil disimpan."}
POST
/scavengers/save-gelas-polos
Save the plain cup weight (column gelas_polos) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelas-polos" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelas_polos' berhasil disimpan."}
POST
/scavengers/save-gelas-warna
Save the coloured cup weight (column gelas_warna) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelas-warna" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelas_warna' berhasil disimpan."}
POST
/scavengers/save-gelas-polos-bunga
Save the large flower-pattern cup weight (column gelas_bunga_besar) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelas-polos-bunga" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelas_bunga_besar' berhasil disimpan."}
POST
/scavengers/save-gelas-yakult-kecil
Save the small Yakult cup weight (column gelas_yakult_kecil) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelas-yakult-kecil" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelas_yakult_kecil' berhasil disimpan."}
POST
/scavengers/save-gelas-yakult-besar
Save the large Yakult cup weight (column gelas_yakult_besar) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelas-yakult-besar" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelas_yakult_besar' berhasil disimpan."}
POST
/scavengers/save-botol-polos-putih
Save the plain white bottle weight (column botol_polos_putih) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-botol-polos-putih" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'botol_polos_putih' berhasil disimpan."}
POST
/scavengers/save-atom-warna-putih
Save the white "atom" plastic weight (column atom_warna_putih) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-atom-warna-putih" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'atom_warna_putih' berhasil disimpan."}
POST
/scavengers/save-gelang-galon
Save the water gallon ring weight (column gelang_galon) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-gelang-galon" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'gelang_galon' berhasil disimpan."}
POST
/scavengers/save-tutup
Save the bottle cap weight (column tutup) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-tutup" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'tutup' berhasil disimpan."}
POST
/scavengers/save-tutup-galon-besar
Save the large gallon cap weight (column tutup_galon_besar) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-tutup-galon-besar" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'tutup_galon_besar' berhasil disimpan."}
POST
/scavengers/save-impek-regas
Save the impek regas (brittle plastic) weight (column impek_regas) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-impek-regas" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'impek_regas' berhasil disimpan."}
POST
/scavengers/save-emperan-warna-warni
Save the mixed-colour emperan plastic weight (column emperan_warna_warni) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-emperan-warna-warni" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'emperan_warna_warni' berhasil disimpan."}
POST
/scavengers/save-mainan-warna
Save the coloured toy plastic weight (column mainan_warna) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-mainan-warna" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'mainan_warna' berhasil disimpan."}
POST
/scavengers/save-botol-bening-lemes
Save the soft clear bottle weight (column botol_bening_lemes) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-botol-bening-lemes" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'botol_bening_lemes' berhasil disimpan."}
POST
/scavengers/save-asoy
Save the asoy (plastic bag) weight (column asoy) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-asoy" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'asoy' berhasil disimpan."}
POST
/scavengers/save-duplex
Save the duplex board weight (column duplex) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-duplex" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'duplex' berhasil disimpan."}
POST
/scavengers/save-styrofoam
Save the styrofoam weight (column styrofoam) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-styrofoam" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'styrofoam' berhasil disimpan."}
POST
/scavengers/save-rdf
Save the shredded output (RDF) weight (column rdf) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-rdf" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'rdf' berhasil disimpan."}
POST
/scavengers/save-residu
Save the residue weight (column residu) from the sorting scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
card_id integer optional RFID card ID (scavenger_member_cards.id) = card_id from GET /get-member. Required when user_id is empty; what the sorting scale uses
user_id integer optional Staff account ID (users.id). Required when card_id is empty
weight number required Weight in kg, ≥ 0
bash
curl -X POST "https://monitoring.xampah.com/api/scavengers/save-residu" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"card_id": 7, "weight": 4.35}'
json
{"card_id": 7, "weight": 4.35}
json
{"success": true, "message": "Data 'residu' berhasil disimpan."}
Waste & MLO Recap
GET
/recap/waste
Daily/weekly/monthly recap: incoming waste, sorted waste, deductions & MLO, per type, per customer
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

MLO (organic waste material) = (weight_in − weight_out) − Pyrolysis feedstock − Incinerator feedstock (incenerator + incenerator_2) − Gabruk, from config/waste.php. Only trucks that have already weighed out are counted. Default group: ≤31 days daily, ≤186 days weekly, longer monthly. Maximum range 731 days; daily at most 186 days.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
group day|week|month optional (default: automatic) Grouping
bash
curl "https://monitoring.xampah.com/api/recap/waste?start_date=2026-09-01&end_date=2026-09-30&group=day" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{
  "success": true, "start_date": "2026-09-01", "end_date": "2026-09-30", "group": "day",
  "formula": {"text": "MLO = (Berat Masuk - Berat Keluar) - Bahan Pirolisis - Bahan Insinerator - Gabruk", "deductions": [...]},
  "totals": {"transactions": 486, "completed": 484, "pending": 2, "weight_in": 4872100, "weight_out": 1707600, "net": 3164500,
             "deductions": {"bahan_pirolisis": 366559, "bahan_incenerator": 273496, "gabruk": 166327},
             "mlo": 2358118, "mlo_scale": 860471, "sorted_total": 1737106.9, "sorted_entries": 217},
  "composition": [{"key": "mlo", "label": "MLO (Organik)", "kg": 2358118, "share": 74.5}, ...],
  "periods": [{"key": "2026-09-01", "label": "Sel, 1 Sep 2026", "start": "2026-09-01", "end": "2026-09-01", "net": 102200, "mlo": 73119, ...}],
  "sorted_by_type": [{"key": "mlo", "label": "MLO (Organik)", "kg": 860471, "share": 49.5}, ...],
  "customers": [{"customer_id": 1, "name": "Pasar Kemiri Muka", "transactions": 80, "net": 520000}]
}
GET
/recap/waste/transactions
Truck weighings over a date range (paginated, searchable)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
status all|completed|pending optional (default: all) Status filter
search string optional Order no., customer, driver or licence plate
page integer optional (default: 1) Page
per_page integer optional (default: 25) Rows per page (max 100)
bash
curl "https://monitoring.xampah.com/api/recap/waste/transactions?start_date=2026-09-01&end_date=2026-09-30&status=completed&search=Pasar" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/recap/waste/sorted
Sorting weighings over a date range, with the non-zero types broken down
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) required Start date (inclusive)
end_date date (Y-m-d) required End date (inclusive), not before start_date
search string optional Order no. or staff name
page integer optional (default: 1) Page
per_page integer optional (default: 25) Rows per page (max 100)
bash
curl "https://monitoring.xampah.com/api/recap/waste/sorted?start_date=2026-09-30&end_date=2026-09-30" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
RFID Cards (Drivers & Sorting Staff)
GET
/get-member
Look up a sorting staff member by RFID card UID (used by the sorting scale)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
uid string required Card UID, e.g. B29BCC4D
bash
curl "https://monitoring.xampah.com/api/get-member?uid=B29BCC4D" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success": true, "data": {"id": 7, "uid": "B29BCC4D", "name": "Momoh", "role_id": 1}}
GET
/scavenger-cards
List sorting staff cards
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
search string optional Search name/UID
page integer optional Page
per_page integer optional Rows per page
bash
curl "https://monitoring.xampah.com/api/scavenger-cards" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/scavenger-cards/{id}
One sorting staff card
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required Card ID
bash
curl "https://monitoring.xampah.com/api/scavenger-cards/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/card-members
List truck driver cards
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
search string optional Search
page integer optional Page
per_page integer optional Rows per page
bash
curl "https://monitoring.xampah.com/api/card-members" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/card-members/{id}
One driver card
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
id integer (path) required Card ID
bash
curl "https://monitoring.xampah.com/api/card-members/{id}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/getMember
Old alias of GET /card-members
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/getMember" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Operator Attendance (RFID)
POST
/attendance
Card tap: clock in, the next tap clocks out
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

A repeated tap within 1 minute is refused (429).

Parameter Type Required Description
uid string required Card UID
operator_name string required Operator name
timestamp datetime required Tap time
bash
curl -X POST "https://monitoring.xampah.com/api/attendance" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"uid": "B29BCC4D", "operator_name": "Momoh", "timestamp": "2026-10-01 07:58:00"}'
json
{"uid": "B29BCC4D", "operator_name": "Momoh", "timestamp": "2026-10-01 07:58:00"}
json
{"success": true, "data": {"action": "time_in", ...}}
GET
/attendance/list
All attendance (paginated)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date optional From
end_date date optional Until
uid string optional Filter by UID
page integer optional Page
per_page integer optional Rows per page
bash
curl "https://monitoring.xampah.com/api/attendance/list" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/attendance/today
Today's attendance
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/attendance/today" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/attendance/present
Operators present now (clocked in, not yet out)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/attendance/present" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/attendance/stats
Attendance statistics
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date optional From
end_date date optional Until
bash
curl "https://monitoring.xampah.com/api/attendance/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/attendance/history
Attendance history of one operator
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
operator string required Operator name
start_date date optional From
end_date date optional Until
limit integer optional Max rows
bash
curl "https://monitoring.xampah.com/api/attendance/history?operator=Momoh" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/attendance/user/{uid}
Attendance by card UID
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
uid string (path) required Card UID
limit integer optional Max rows
bash
curl "https://monitoring.xampah.com/api/attendance/user/{uid}" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"

Jatisari API Endpoints

Biogas production monitoring and weight tracking for the Jatisari location

Biogas Monitoring
POST
/biogas/jatisari/push
Ingest a new sensor reading
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
ph float required pH of the digester liquid
temp_liquid float required Liquid temperature (°C)
temp_ambien float required Ambient temperature (°C)
weight float required Feed weight (kg)
gas_prod float required Gas production (L/h)
temp_gas_prod float required Produced gas temperature (°C)
pressure_gas_prod float required Produced gas pressure (bar)
gas_used float required Gas consumed (L/h)
temp_gas_used float required Used gas temperature (°C)
pressure_gas_used float required Used gas pressure (bar)
balloon_level_1 float optional Balloon 1 level (%)
balloon_level_2 float optional Balloon 2 level (%)
storage float optional Storage volume (m³)
bash
curl -X POST "https://monitoring.xampah.com/api/biogas/jatisari/push" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/jatisari/latest
Latest biogas reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/biogas/jatisari/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/jatisari/history
Time-series data by hour window
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
hours integer optional (default: 24) Look-back window in hours
bash
curl "https://monitoring.xampah.com/api/biogas/jatisari/history" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/jatisari/stats
Aggregate stats over N days
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
days integer optional (default: 7) Number of days to aggregate
bash
curl "https://monitoring.xampah.com/api/biogas/jatisari/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
Weight Monitoring
POST
/weight/push
Push a weight reading from the scale
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
weight float required Weight in kg (min: 0.01)
bash
curl -X POST "https://monitoring.xampah.com/api/weight/push" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/weight/latest
Latest weight reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/weight/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/weight/history
Weight history by hour window
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
hours integer optional (default: 24) Look-back window in hours
bash
curl "https://monitoring.xampah.com/api/weight/history" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/weight/stats
Weight statistics over N days
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
days integer optional (default: 7) Number of days to aggregate
bash
curl "https://monitoring.xampah.com/api/weight/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
POST
/weight/jatisari/push
Send a Jatisari scale reading (same as /weight/push)
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
weight number required Weight (kg), at least 0.01
bash
curl -X POST "https://monitoring.xampah.com/api/weight/jatisari/push" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"weight": 152.4}'
json
{"weight": 152.4}
GET
/weight/jatisari/latest
Latest scale reading
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/weight/jatisari/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/weight/jatisari/history
Scale history by hour window
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
hours integer optional (default: 24) Look-back window (hours)
limit integer optional Max rows
bash
curl "https://monitoring.xampah.com/api/weight/jatisari/history?hours=48" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/weight/jatisari/stats
Scale statistics over N days
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
days integer optional (default: 7) Number of days
bash
curl "https://monitoring.xampah.com/api/weight/jatisari/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"

Indramayu API Endpoints

Biogas production and consumption monitoring for the Indramayu site

Biogas Monitoring
POST
/biogas/indramayu/push
Ingest a new sensor reading
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
gas_prod float required Gas production flow rate (L/h)
temp_gas_prod float required Temperature at the production point (°C)
press_gas_prod float required Pressure at the production point (bar)
gas_cons float required Gas consumption flow rate (L/h)
temp_gas_cons float required Temperature at the consumption point (°C)
press_gas_cons float required Pressure at the consumption point (bar)
bash
curl -X POST "https://monitoring.xampah.com/api/biogas/indramayu/push" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/indramayu/latest
Most recent sensor record
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

bash
curl "https://monitoring.xampah.com/api/biogas/indramayu/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/indramayu/history
Time-series data by hour window
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
hours integer optional (default: 24) Look-back window in hours
limit integer optional (default: 100) Max rows returned (max 500)
bash
curl "https://monitoring.xampah.com/api/biogas/indramayu/history" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/indramayu/stats
Aggregate stats over N days
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
days integer optional (default: 7) Number of days to aggregate
bash
curl "https://monitoring.xampah.com/api/biogas/indramayu/stats" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/biogas/indramayu/paginated
Biogas history by page, optionally within a date range
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
start_date date (Y-m-d) optional Start date
end_date date (Y-m-d) optional End date, not before start_date
per_page integer optional (default: 15) Rows per page (max 200)
page integer optional (default: 1) Page
bash
curl "https://monitoring.xampah.com/api/biogas/indramayu/paginated?start_date=2026-09-01&end_date=2026-09-30&per_page=50" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
POST
/biogas/indramayu/push-with-location
Same as /push, with an optional location field (must be "indramayu")
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

Parameter Type Required Description
gas_prod number required Gas produced
temp_gas_prod number required Produced gas temperature (°C)
press_gas_prod number required Produced gas pressure
gas_cons number required Gas used
temp_gas_cons number required Used gas temperature (°C)
press_gas_cons number required Used gas pressure
location string optional Must be "indramayu" when sent
bash
curl -X POST "https://monitoring.xampah.com/api/biogas/indramayu/push-with-location" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"gas_prod":120.5,"temp_gas_prod":45.2,"press_gas_prod":2.5,"gas_cons":85.3,"temp_gas_cons":42.1,"press_gas_cons":2.1,"location":"indramayu"}'
json
{"gas_prod":120.5,"temp_gas_prod":45.2,"press_gas_prod":2.5,"gas_cons":85.3,"temp_gas_cons":42.1,"press_gas_cons":2.1,"location":"indramayu"}

JakBar API Endpoints

Reactor telemetry (up to 20 reactors + 16 relays per gateway) and fleet management (OTA firmware rollout, MQTT debug log, remote commands) for the JakBar ESP32 gateways

Reactor Telemetry
POST
/reactor/jakbar/ingest
Push the hourly telemetry batch (all reactors + relays). Requires the X-API-KEY header. One endpoint handles both telemetry and event payloads - the server tells them apart by "type". Firmware 1.3.0+ adds per reactor: dist_mm (ultrasonic distance), balloon (biogas balloon fill 0-100) and bal_st (bit0 valve open, bit1 vent on, bit2 overfull, bit3 failsafe, bit4 uncalibrated) - all optional, null when not measured.
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

bash
curl -X POST "https://monitoring.xampah.com/api/reactor/jakbar/ingest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"type":"telemetry","device_id":"gateway-01","fw":"1.3.0", "uptime_ms":3600000,"slot_ts":1788159600, "reactors":[{"id":1,"gas":123.45,"ph":7.21,"lt":35.40,"at":29.10, "dist_mm":620,"balloon":82,"bal_st":1, "health":"ONLINE","gas_health":"NOPOLL","node_health":"ONLINE", "age_s":2,"faults":0}], "relays":[{"n":1,"name":"Pompa Feed 1","on":true,"left_s":1740}]}'
json
{"type":"telemetry","device_id":"gateway-01","fw":"1.3.0",
 "uptime_ms":3600000,"slot_ts":1788159600,
 "reactors":[{"id":1,"gas":123.45,"ph":7.21,"lt":35.40,"at":29.10,
               "dist_mm":620,"balloon":82,"bal_st":1,
               "health":"ONLINE","gas_health":"NOPOLL","node_health":"ONLINE",
               "age_s":2,"faults":0}],
 "relays":[{"n":1,"name":"Pompa Feed 1","on":true,"left_s":1740}]}
json
{"success":true,"batch_id":42}
POST
/reactor/jakbar/ingest
Push an immediate alarm event (same endpoint as telemetry, "type":"event"). Requires the X-API-KEY header. BALLOON_VALVE_OPEN/CLOSED, BALLOON_VENT_ON/OFF and BALLOON_FAILSAFE carry the balloon fill % in detail (255 = unknown).
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

bash
curl -X POST "https://monitoring.xampah.com/api/reactor/jakbar/ingest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"type":"event","uptime_ms":812345,"id":7, "event":"NODE_OFFLINE","detail":0}'
json
{"type":"event","uptime_ms":812345,"id":7,
 "event":"NODE_OFFLINE","detail":0}
json
{"success":true}
POST
/reactor/jakbar/ingest
Firmware 1.4.0+: balloon node(s) every minute (same endpoint, "type":"balloon"). Requires the X-API-KEY header. Stored in balloon_readings, upsert on (device, id, slot_ts) - never as a telemetry batch. sol_temp = dump solenoid temperature; dist_mm/balloon/sol_temp are null when not measured.
Device API key

Access: X-API-KEY header (scope * — read-only keys are refused with 403).

bash
curl -X POST "https://monitoring.xampah.com/api/reactor/jakbar/ingest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"type":"balloon","device_id":"gateway-01","fw":"1.4.0", "uptime_ms":3660000,"slot_ts":1788159660, "balloons":[{"id":16,"dist_mm":862,"balloon":58,"bal_st":0,"sol_temp":34.50, "health":"ONLINE","age_s":2,"faults":0}]}'
json
{"type":"balloon","device_id":"gateway-01","fw":"1.4.0",
 "uptime_ms":3660000,"slot_ts":1788159660,
 "balloons":[{"id":16,"dist_mm":862,"balloon":58,"bal_st":0,"sol_temp":34.50,
              "health":"ONLINE","age_s":2,"faults":0}]}
json
{"success":true,"count":1}
GET
/reactor/jakbar/balloons/latest
Newest per-minute reading of every balloon node, with balloon_state {vent_on, overfull, failsafe, uncalibrated, fan_on, pump_on} decoded from bal_st.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/balloons/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/reactor/jakbar/balloons/history
One balloon node's per-minute readings, newest first (default last 60 minutes)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
reactor_id integer required Balloon node address (16 at JakBar)
minutes integer optional (default: 60) Look-back window (max 10080 = 7 days)
limit integer optional (default: 500) Max rows (max 2000)
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/balloons/history?reactor_id=1" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/reactor/jakbar/latest
Latest telemetry batch, reshaped into the same reactors[]/relays[] shape the gateway itself POSTs. Each reactor also carries balloon_state {valve_open, vent_on, overfull, failsafe, uncalibrated} decoded from bal_st.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/latest" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/reactor/jakbar/history
One reactor's sensor history across a date range (default last 7 days)
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
reactor_id integer required Reactor number (1-20)
start_date date optional Y-m-d, needs end_date too
end_date date optional Y-m-d, needs start_date too
limit integer optional (default: 200) Max rows (max 500)
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/history?reactor_id=1" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/reactor/jakbar/events
Recent alarm events (NODE_OFFLINE, GAS_OFFLINE, SENSOR_FAULT, RELAY_ON/OFF, BALLOON_VENT_ON, etc), default last 24 hours
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
event_type string optional Filter to one event type
hours integer optional (default: 24) Look-back window (max 720)
limit integer optional (default: 100) Max rows (max 500)
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/events" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
GET
/reactor/jakbar/gas-meters
Every gas meter (firmware 1.6.0+) by Modbus address and role: REACTOR (one reactor's production), PRODUCTION_TOTAL (several reactors together), CONSUMPTION (gas used). Newest hourly reading plus the newest VALID cumulative counter (volume_l / volume_m3), so a meter that is offline right now still shows how much gas has gone through it. Firmware 1.6.0+ adds `live` (from MQTT, about one minute old: counter, today since 00:00 WIB, valve, health, read_ts, age_s) and `flow_l_min`.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/gas-meters" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success":true,"count":3,"data":[{"addr":3,"role":"CONSUMPTION","reactor":null,"label":null,"health":"ONLINE","valve_code":2,"valve":"open","slot_ts":1793750400,"age_s":3,"volume_l":1200,"volume_m3":1.2,"volume_slot_ts":1793750400}]}
GET
/reactor/jakbar/gas-meters/usage
Gas through one meter per hour / day / month (Asia/Jakarta): production for a REACTOR or PRODUCTION_TOTAL meter, gas used for the CONSUMPTION meter. Difference of consecutive counter readings; a period without data is null (not 0) and a counter that went down (meter replaced) is skipped and counted in counter_resets.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
addr integer optional Meter Modbus address (1-247); this or role
role REACTOR|PRODUCTION_TOTAL|CONSUMPTION optional Pick the meter by role when only one has it
interval hour|day|month optional (default: day) Bucket size (range max 31 / 366 / 3660 days)
start_date date optional Y-m-d, needs end_date too (default last 24 h / 30 days / 12 months)
end_date date optional Y-m-d, inclusive
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/gas-meters/usage" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success":true,"meter":{"addr":3,"role":"CONSUMPTION","reactor":null,"label":null},"interval":"day","timezone":"Asia/Jakarta","start":"2026-11-03 00:00:00","end":"2026-11-05 00:00:00","total_usage_l":1330,"total_usage_m3":1.33,"counter_resets":0,"count":2,"data":[{"period":"2026-11-03","start_ts":1793638800,"usage_l":1000,"readings":3,"usage_m3":1}]}
GET
/reactor/jakbar/gas-meters/minutes
One meter's per-minute readings from the live MQTT feed (<site>/<device_id>/meters, firmware 1.6.0+), oldest first: counter, litres used since the previous reading (used_l) and the flow in litres per minute. The meters are battery powered and read once a minute; rows older than 90 days are pruned.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
addr integer optional Meter Modbus address (1-247); this or role
role REACTOR|PRODUCTION_TOTAL|CONSUMPTION optional Pick the meter by role when only one has it
minutes integer optional (default: 60) Look-back window (max 1440)
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/gas-meters/minutes" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success":true,"meter":{"addr":3,"role":"CONSUMPTION","reactor":null,"label":null},"minutes":60,"total_used_l":84,"count":60,"data":[{"slot_ts":1793858400,"volume_l":32890,"used_l":2,"flow_l_min":2,"valve_code":2,"health":"ONLINE"}]}
GET
/reactor/jakbar/gas-meters/cumulative
Lifetime total of one meter since its first reading, this month and today, plus the running (cumulative) total per day or month up to today (Asia/Jakarta). Same counter differences as /gas-meters/usage, so the last cumulative value equals lifetime and any period matches /usage. A day without readings has usage null and keeps the cumulative.
API key (read) / login

Access: X-API-KEY header with the read or * scope, or Authorization: Bearer token from POST /login.

Parameter Type Required Description
addr integer optional Meter Modbus address (1-247); this or role
role REACTOR|PRODUCTION_TOTAL|CONSUMPTION optional Pick the meter by role when only one has it
interval day|month optional (default: day) Running total per day or per month
device_id string optional (default: gateway-01) Which gateway to read
bash
curl "https://monitoring.xampah.com/api/reactor/jakbar/gas-meters/cumulative?role=PRODUCTION_TOTAL&interval=month" \
  -H "Accept: application/json" \
  -H "X-API-KEY: sk_xxxxxxxx"
json
{"success":true,"meter":{"addr":2,"role":"PRODUCTION_TOTAL","reactor":null,"label":null},"interval":"month","timezone":"Asia/Jakarta","first_reading_at":"2026-09-30 01:00:00","last_reading_at":"2026-11-09 21:30:00","lifetime_l":98120,"lifetime_m3":98.12,"this_month_l":32218,"this_month_m3":32.218,"today_l":3105,"today_m3":3.105,"counter_resets":0,"count":3,"data":[{"period":"2026-09","usage_l":400,"usage_m3":0.4,"cumulative_l":400,"cumulative_m3":0.4},{"period":"2026-10","usage_l":65502,"usage_m3":65.502,"cumulative_l":65902,"cumulative_m3":65.902},{"period":"2026-11","usage_l":32218,"usage_m3":32.218,"cumulative_l":98120,"cumulative_m3":98.12}]}

400
Bad Request — Invalid parameters or validation failure
401
Unauthorized — Missing or invalid credentials
404
Not Found — Resource or location does not exist
429
Too Many Requests — Rate limit exceeded
500
Internal Server Error — Unexpected server-side failure

Quick Test — curl
bash
# Check the server (public)
curl https://monitoring.xampah.com/api/ping

# Read data: X-API-KEY (read scope)
curl -H "X-API-KEY: sk_xxxxxxxx" "https://monitoring.xampah.com/api/biogas-data/latest"

# Waste recap for September (Depok)
curl -H "X-API-KEY: sk_xxxxxxxx" "https://monitoring.xampah.com/api/recap/waste?start_date=2026-09-01&end_date=2026-09-30"

# Or with the admin dashboard login
TOKEN=$(curl -s -X POST https://monitoring.xampah.com/api/login -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"..."}' | jq -r .data.token)
curl -H "Authorization: Bearer $TOKEN" https://monitoring.xampah.com/api/getCustomer

# Send data from a device: device X-API-KEY
curl -X POST https://monitoring.xampah.com/api/reactor/jakbar/ingest \
  -H "Content-Type: application/json" -H "X-API-KEY: sk_xxxxxxxx" \
  -d '{"type":"telemetry","device_id":"gateway-01","reactors":[{"id":1,"gas":123.45,"ph":7.21,"lt":35.4,"at":29.1}]}'
Copied to clipboard!