Receive Heartbeat & Get Job
Endpoint called periodically by the managed device (via scheduler). Sends device status (heartbeat) and receives the next pending job script, if any. Requires SiteAuth
middleware (device-specific Bearer token).
Authorizations
Device-specific authentication token (encrypted site ID) obtained during adoption. Required for /poll
and /notify/delete
endpoints.
Body
RouterOS script output containing device status info (similar to adoption, but potentially less fields or updated values).
The body is of type string
.
"name=MyDevice;serial-number=ABC123XYZ;...uptime=2d0h5m10s;cpu-load=10;free-memory=850000000;..."
Response
OK. Returns the next pending job script for the device to execute.
The response is of type string
.
"# Job Wrapper Script Start\n:local jobId \"jobTokenExample\";\n:local busyUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=busy&signature=...\";\n:local doneUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=done&signature=...\";\n:local failUrl \"https://api.altostrat.io/job/job-uuid-here/update?status=fail&signature=...\";\n:do { /tool fetch url=\\$busyUrl keep-result=no } on-error={};\n:do {\n # Actual Job Payload Start\n /ip address add address=192.168.99.1/24 interface=ether2 comment=\"Managed by Altostrat\";\n # Actual Job Payload End\n :do { /tool fetch url=\\$doneUrl keep-result=no } on-error={};\n} on-error={ :do { /tool fetch url=\\$failUrl keep-result=no } on-error={} };\n:log info (\"Job \" . \\$jobId . \" finished. Remaining: 0\");\n# Job Wrapper Script End\n"