Workspace

API

A REST API for the distribution company’s systems: metering (AMI), billing, field-work management. Data are uploaded and collected without manual exports. Permissions are the same as in the workspace: an account sees only its own organisation’s projects.

Connection

Requests

RequestWhat it does
POST /sessionsign in: {"login", "password"} → {"token", "expires_in", "user"}
GET /methe signed-in account: login, name, role
GET /projectsthe organisation’s projects
POST /projectscreate a project: {"name", "name_en"}
GET /projects/{id}project: substations with data periods, last calculation
POST /projects/{id}/filesupload files (field file, several allowed) → an ingest task per file
GET /tasks/{id}task status: queued, running, done, failed; for ingest — what was recognised in the file, for a calculation — its number and summary
POST /projects/{id}/runstart a calculation → task; if one is already running — its task
GET /projects/{id}/runsproject calculations: number and time
GET /projects/{id}/runs/{run}calculation summary by substation: period, number of meters, imbalance, number of targets
GET /projects/{id}/runs/{run}/targetsfield targets in priority order
GET /projects/{id}/outcomesrecorded field-visit outcomes
POST /projects/{id}/outcomesrecord an outcome: {"substation", "target", "outcome", "note"}; outcome — found, not_found, no_access

Creating projects, uploading files and starting calculations requires the manager role; inspectors can also record visit outcomes.

Field target

FieldMeaning
priorityposition in the visit order
substation, possubstation
targettarget key — used to record the visit outcome
meter, labelmeter number and its name
address, lat, lonaddress and coordinates
kindtarget type: theft — unmetered consumption, extra — meter of another substation, fault — fault
categoriesfinding codes for the target
probabilityprobability of confirmation, %, where measured
unaccounted_kwh, metered_kwhestimated unmetered and metered energy for the period, kWh
outcomerecorded visit outcome

Typical sequence

  1. POST /session — get a token;
  2. POST /projects/{id}/files — send the export; wait for the tasks via GET /tasks/{id};
  3. POST /projects/{id}/run — start the calculation; wait for the task;
  4. GET /projects/{id}/runs/{run}/targets — collect the targets;
  5. POST /projects/{id}/outcomes — return the visit outcomes.

API access is issued together with the organisation’s account.

More on the topic

← GRID-IN home