Advanced API Usage
Submitting meter readings
Readings are submitted per device. The device is addressed by its identifier in the path.
POST /api/meter-reads/new/:id
Authorization: Bearer <token>
Content-Type: application/jsonTwo reading types exist and are issued by different pipelines:
| Type | Meaning | Issued by |
|---|---|---|
History | A reading for a past period, submitted after the fact | The historical-issuance job |
Delta | An incremental reading for the current, ongoing period | The late-ongoing engine (see below) |
POST /api/meter-reads/:id is the legacy form of the same call and is kept for existing integrations. Administrators can submit on behalf of a device with POST /api/meter-reads/addByAdmin/new/:externalId.
Every reading is validated against the device's plausible maximum output for the period (capacity × hours, adjusted for device age and yield). Implausible readings are rejected with 409 and not stored — see Troubleshooting.
Readings from CSV
A CSV of readings for one device can be ingested directly:
POST /api/meter-reads/csv-ingest/:externalId
Authorization: Bearer <token>
Content-Type: multipart/form-dataBulk device upload (CSV)
Register many devices at once from a CSV file:
POST /api/bulk-upload(multipart,.csvonly) — creates a bulk-upload job and returns itsbulkUploadId.POST /api/bulk-upload/:bulkUploadId/confirm— confirms and processes the job.GET /api/bulk-uploadlists jobs;GET /api/bulk-upload/bulk-upload-log/:bulkUploadIdreturns the per-row outcome.
How issuance works (late-ongoing engine)
Delta readings are certified in daily issuance cycles per device group. The engine only issues for windows that have a cycle, so two operations matter:
Create missing cycles for a group — builds the daily cycles that do not yet exist:
httpPOST /api/drec-issuer/missinglateongoing/onetimerun?groupId=<groupId>Process issuance for a group — mints certificates for every open cycle that has readings:
httpGET /api/drec-issuer/lateongoing?groupId=<groupId>
Processing also runs automatically on a schedule (see the cron job list). A cycle is matched to readings by the reading's endDate falling inside the cycle window; a cycle with no readings stays open until readings arrive.
Exporting data
- Per-device certificate log as CSV —
GET /api/certificate-log/expoert_perdevice/:groupUidstreams a CSV download (the path segment is spelled exactly as shown). - Redemption report —
GET /api/certificate-log/redemption-report. - Every resource is also available as JSON through its
GETendpoints (devices, groups, readings, certificate logs); see the Endpoints Reference.
Device capacity
capacity on a device is in kW. It is used by the reading validation above, so keep it current when a site is upgraded — otherwise readings from the larger installation are rejected as implausible.
