Požiadavky a odpovede koncových bodov administrátorského API pracovného priestoru
Toto je referencia požiadaviek a odpovedí pre každý koncový bod /v2/admin. Autentifikácia, idempotencia, limity frekvencie, vytváranie tokenov a význam rozsahov sú zdokumentované v časti Administrátorské API pracovného priestoru. Opakovane použiteľné typy polí a príklady sú v časti Schémy a príklady. Každý riadok koncového bodu čítajte spolu s Kontraktom odpovedí a chýb, ktorý uvádza všetky možné spoločné a špecifické telá neúspešných odpovedí.
Spoločný kontrakt
Každá cesta začína pôvodom nasadenej služby app-api. Pracovný priestor sa odvodzuje výhradne z autentifikovaného tokenu; klienti nesmú posielať cpoId. Všetky zdokumentované hodnoty :...Id v cestách zdrojov sú kladné desiatkové celé čísla. Každá požiadavka vyžaduje presne jednu:
Authorization: Bearer <workspace-access-token>
Požiadavky zobrazené s telom JSON vyžadujú Content-Type: application/json. Všetky zmenové operácie vyžadujú Idempotency-Key (POST, PUT, PATCH a DELETE) vrátane POST /v2/admin/reports/send; pokiaľ riadok neuvádza inak, typ obsahu úspešnej odpovede je application/json, dátumy JSON sú reťazce RFC 3339 a čísla sú čísla JSON.
Každá požiadavka môže obsahovať X-Request-Id a X-Error-Format: envelope; pozrite Kontrakt odpovedí a chýb. Tieto hlavičky nemenia schémy úspešných odpovedí.
Označenia použité nižšie:
noneznamená žiadne telo požiadavky.DELETE, pri ktorom je zdokumentované telo JSON, ho stále vyžaduje.?označuje voliteľnú vlastnosť alebo parameter dopytu.T | nullznamená, že vlastnosť je prítomná a môže byť null.204 emptyznamená žiadne telo odpovede.CursorPage<T>znamená{ items: T[], nextCursor: number|string|null }, okrem prípadu, keď riadok výslovne pomenúva objektpagealebopagination.- Všetky prípady chýbajúceho vnoreného zdroja vrátane ID z iných pracovných priestorov používajú
404 { "error": "Workspace resource not found", "code": "RESOURCE_NOT_FOUND" }, pokiaľ funkcia nedokumentuje konkrétnejší konflikt.
Spoločné schémy požiadaviek
Vstupy pracovného priestoru a lokality
WorkspacePatch = {
name?: string(1..100), email?: email|null, website?: string|null,
addressLine1?: string|null, addressLine2?: string|null,
postalCode?: string|null, city?: string|null, state?: string|null,
countryId?: positive integer
} // at least one property
SiteInput = {
name: string(1..255), description?: string|null = null,
addressLine1?: string|null = null, addressLine2?: string|null = null,
postalCode?: string|null = null, city?: string|null = null, state?: string|null = null,
countryId: positive integer, timezoneId: positive integer,
latitude?: number[-90,90]|null = null, longitude?: number[-180,180]|null = null
}
Vstup riadenia výkonu
PowerConfigurationInput = { pools: PowerPoolInput[0..200] }
PowerPoolInput = {
id?: positive integer|null, name?: string(0..255),
limit: integer[0,100000000], meterSources?: ExternalMeterInput[0..16],
children?: (PowerPoolInput | ChargerPoolChild)[0..1000]
}
ChargerPoolChild = { chargepointId: positive integer, priority?: integer[-1000000,1000000] }
ExternalMeterInput = {
id?: positive integer|null, sourceId?: positive integer|null,
provider?: "perific", name?: string(0..255), externalId: string(1..80),
measurementMode?: "available_headroom"|"external_non_ev_load_only"|"total_site_load_including_ev",
valueMode?: "perific_relative"|"perific_direct"|"perific_meter",
reserveA?: integer[0,100000], offlineSafeA?: integer[0,100000],
ttlSeconds?: integer[30,86400], enabled?: boolean
}
Vstupy nabíjačiek
ChargerCreate = { name: string(1..40), identifier: string(1..40), password?: string(0..40) = "", siteId: positive integer }
ChargerPatch = {
name?: string(1..40), siteId?: positive integer, invertedRfid?: boolean,
smartMode?: integer[0,3], automationDisabled?: boolean
} // at least one
ConnectorPatch = {
connectorFormatId: positive integer, connectorTypeId: positive integer,
powerTypeId: positive integer, maxVoltage: integer[1,10000],
maxAmperage: integer[1,10000], maxElectricPower: integer[1,100000000]
}
Vstupy výkazov
ReportFilters = {
from?: RFC3339, to?: RFC3339, siteId?: positive integer,
chargerId?: positive integer, userId?: positive integer,
anonymous?: true|false|1|0, active?: true|false|1|0
}
ReportScheduleInput = {
enabled: boolean, recipientEmail: email(max 255; may be empty only when disabled), format: "csv"|"pdf",
sendDay: integer[1,28], sendTime: UTC "HH:mm"
}
Rozsahy výkazov musia spĺňať from < to a nesmú presiahnuť 90 dní. Pri vynechaní sa použije posledných 90 dní. userId a anonymous=true sa navzájom vylučujú. Plánované exporty dobiehajú zmeškanú minútu UTC a používajú obmedzené opakovania (odstup 5/10 minút, 30-minútová rezervácia zastaranej úlohy, tri pokusy).
Vstupy taríf
TariffInput = {
name: string(1..64),
exactly one of currencyId: positive integer, currencyCode: 3 letters, currency: 3 letters,
biddingZoneId?: positive integer|null, tax?: finite number
}
TariffComponentInput = {
typeId: positive integer, seasonId: positive integer, priority?: finite number,
price: finite number, validFromMonth?: finite number, validToMonth?: finite number,
validFromWeekDay?: finite number, validToWeekDay?: finite number,
validFromHour?: finite number, validToHour?: finite number
}
TariffAssignmentCreateInput = { tariffId: positive integer, connectorId?: nonnegative integer }
TariffAssignmentUpdateInput = { tariffId: positive integer, connectorId: positive integer }
Vstupy nabíjacích profilov
ChargingProfileInput = {
label: string(1..40), locationId: positive integer, stackLevel: nonnegative number,
purposeId: positive integer, kindId: positive integer,
recurrencyKindId?: positive integer|null, validFrom?: RFC3339|null,
validTo?: RFC3339|null, startSchedule?: RFC3339|null,
rateUnitId: positive integer, minChargingRate?: nonnegative number|null
}
ChargingProfileCreate = ChargingProfileInput & { schedule?: SchedulePeriod[0..256] }
SchedulePeriod = { startPeriod: nonnegative number, limit: nonnegative number, numberOfPhases?: positive integer|null }
ChargingScheduleInput = { rateUnitId: positive integer, periods: SchedulePeriod[1..256] }
ProfileAssignmentInput = { profileId: positive integer, connectorId?: nonnegative integer }
Vstupy používateľov
UserCreate = { email: email(max 255), name: string(1..255) }
InvitationInput = {
email: email, name?: string|null, rfid?: string|null,
allChargers?: boolean, chargerIds?: unique positive integer[0..500]
} // chargerIds must be non-empty unless allChargers=true
AccessInput = { allChargers?: boolean, chargerIds?: unique positive integer[0..500] }
LimitCreate = { limitTypeId: positive integer, energyValue?: nonnegative integer = 0, timeValue?: nonnegative integer = 0 }
LimitPatch = { limitTypeId?: positive integer, energyValue?: nonnegative integer, timeValue?: nonnegative integer }
Pri vytváraní limitu musí byť aspoň jedno z energyValue alebo timeValue väčšie než nula. Z e-mailov sa odstránia okrajové medzery a písmená sa zmenia na malé. RFID UID sa prijímajú iba pri zápise a v odpovediach na čítanie sú maskované.
Súhrn DTO odpovedí
Tabuľky koncových bodov zobrazujú každú obálku odpovede na najvyššej úrovni. Toto sú hlavné opakovane použiteľné DTO v týchto obálkach:
| DTO | Polia |
|---|---|
Workspace | id, name, email, website, address { line1, line2, postalCode, city, state, countryId, countryCode, countryName }, createdAt, updatedAt |
Site | id, name, description, address, timezone { id, name }, latitude, longitude, chargerCount; podrobnosti pridávajú normalizované chargers a stav konektora |
GeocodeCandidate | placeId, displayName, latitude, longitude; prihlasovacie údaje poskytovateľa ani jeho špecifické metadáta sa nikdy nevracajú |
MetricsWindow | from, to, limity/počty relácií a totalsCapped, ak sa uplatňuje |
Charger | id, name, identifier, cpoId, site, normalizované status, isPublic, príznaky RFID/inteligentného nabíjania/automatizácie, provisioned, connection, evses, connectors, createdAt, updatedAt; podrobnosti pridávajú configuration so skrytými citlivými údajmi, firmware a počty |
Connector | portId, connectorId, ID referenčných údajov konektora, maxVoltage, maxAmperage, maxElectricPower |
ReportSession | id, nabíjačka/lokalita, ID portu a konektora, minimálne údaje používateľa, active, energyWh, začiatok/koniec/trvanie a čisté náklady/daň/celkové náklady podľa meny |
ReportSchedule | id, workspaceId, enabled, recipientEmail, format, UTC sendDay/sendTime, metadáta vytvorenia/aktualizácie a bezpečné metadáta posledného doručenia vrátane počtu pokusov |
Tariff | id, cpoId, name, objekty typu/lokality/meny/obchodnej zóny, tax, fallbackPrice, efektívne price, components, assignmentCount |
ChargingProfile | id, cpoId, label, description, stackLevel, objekty lokality/účelu/druhu/opakovania/jednotky limitu, platnosť, harmonogram, assignmentCount, časové pečiatky |
User | id, membershipId, name, email, maskované rfids, access nabíjačky, limitCount; podrobnosti pridávajú phone, createdAt a limits. Autorizačné údaje OCPP, napríklad contractId, sa nikdy nevracajú. |
RFID | id, maskedUid, name, type, valid; nespracované UID sa nikdy nevracia |
Access | allChargers, zoradené chargerIds a items s metadátami prístupu/nabíjačky/lokality/expirácie |
Limit | id, limitTypeId, label, energyValue, timeValue |
LocalUser | DTO zoznamu: id, customerId, name, email, expiresAt, systemManaged. Zmenové operácie lokálnych používateľov používajú odlišné tvary LocalUserMutation/LocalUserUpdate v časti Schémy a príklady. |
Referenčné objekty vracajú trasy zoznamov a podrobností, aby volajúci mohli zistiť platné ID. Neznáme pridané polia považujte za rozšírenia kompatibilné s budúcimi verziami a rozhodujte sa iba podľa zdokumentovaných stabilných polí a chybových kódov.
Koncové body pracovného priestoru
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin | workspaces:read | Telo: žiadne | 200 { workspace: Workspace } |
PATCH /v2/admin | workspaces:update | Telo: WorkspacePatch | 200 { workspace: Workspace } |
GET /v2/admin/dashboard | workspaces:read + reports:read | Telo/dopyt: žiadne | 200 { window, stats { chargerCount, onlineChargerCount, siteCount, userCount }, sessions: DashboardSession[], analytics }; relácie sú obmedzené na 1 000 za 90 dní |
Koncové body lokalít a riadenia výkonu
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/sites | sites:read | Telo/dopyt: žiadne | 200 { items: Site[], metricsWindow: MetricsWindow, lookups { countries, timezones } } |
GET /v2/admin/sites/geocode | sites:read | Dopyt: voliteľné street (najviac 160), city, state, country (každé najviac 100), countryCode (najviac 2); voliteľná hlavička Accept-Language; ulica/mesto/región musia spolu obsahovať aspoň dva znaky | 200 { results: GeocodeCandidate[] }; rovnaké prebiehajúce vyhľadávania sa zlúčia a práca poskytovateľa používa ohraničený sekvenčný front a ohraničenú vyrovnávaciu pamäť servera; neplatné vyhľadávania vracajú 400 INVALID_GEOCODE_QUERY, plný front vracia 429 GEOCODING_BUSY s Retry-After a zlyhania poskytovateľa vracajú 502 GEOCODING_UNAVAILABLE |
POST /v2/admin/sites | sites:create | Telo: SiteInput | 201 { site: Site } |
GET /v2/admin/sites/:siteId | sites:read + reports:read | Telo/dopyt: žiadne | 200 { site: SiteDetail, recentSessions: SiteSession[], totals, metricsWindow } |
PATCH /v2/admin/sites/:siteId | sites:update | Telo: úplné SiteInput | 200 { site: Site } |
DELETE /v2/admin/sites/:siteId | sites:delete | Telo: žiadne | 204 empty; neprázdna lokalita vráti 409 SITE_NOT_EMPTY |
GET /v2/admin/sites/:siteId/power-management | sites:power-management | Telo/dopyt: žiadne | 200 { configuration: PowerConfiguration } obsahujúce vlastnenú lokalitu, nabíjačky/konektory, skupiny, zdroje meraní, priradenia a stav kompatibility |
PUT /v2/admin/sites/:siteId/power-management | sites:power-management | Telo: PowerConfigurationInput | 200 { configuration: PowerConfiguration }; odmietnutie OCPP, uplynutie času alebo súbežná zmena vráti 409 POWER_MANAGEMENT_CONFLICT bez použitia náhrady |
Koncové body nabíjačiek
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/chargers | chargers:read | Telo/dopyt: žiadne | 200 { items: Charger[], metricsWindow: MetricsWindow, connectorLookups { formats, types, powerTypes } } |
POST /v2/admin/chargers | chargers:create | Telo: ChargerCreate; identifikátor sa prevedie na veľké písmená | 201 { charger: Charger }; heslo sa nikdy nevracia |
GET /v2/admin/chargers/:chargerId | chargers:read | Telo/dopyt: žiadne | 200 { charger: ChargerDetail } |
PATCH /v2/admin/chargers/:chargerId | chargers:update | Telo: ChargerPatch | 200 { charger: ChargerDetail } |
DELETE /v2/admin/chargers/:chargerId | chargers:delete | Telo: žiadne | 204 empty |
PATCH /v2/admin/chargers/:chargerId/credentials | chargers:credentials | Telo: { password: string(0..40) } | 200 { success: true } |
PATCH /v2/admin/chargers/:chargerId/connectors/:portId | chargers:connector-settings | Telo: ConnectorPatch | 200 { connector: Connector } |
PATCH /v2/admin/chargers/:chargerId/public-listing | chargers:public | Telo: { isPublic: boolean } | 200 { isPublic: boolean }; nesplnená pripravenosť vráti 409 CHARGER_CONFLICT |
GET /v2/admin/chargers/:chargerId/public-readiness | chargers:read | Telo/dopyt: žiadne | 200 { readiness: { ready, missingRequirements, connectorIds, missingTariffConnectorIds, ...commercialState } } |
GET /v2/admin/chargers/:chargerId/logs | chargers:read | Dopyt: cursor?, limit?=50 (1..200), from?, to?, action?, direction?, levelId? | 200 { items: RedactedOcppLog[], nextCursor: number or null } |
GET /v2/admin/chargers/:chargerId/sessions | chargers:read + reports:read | Dopyt: page?=1, limit?=25 (1..100), from?, to?, customerId?: positive integer or "unknown" | 200 { items: ChargerSession[], pagination { page, limit, total, totalPages }, filters { customers }, totals, totalsCapped } |
GET /v2/admin/chargers/:chargerId/qr | chargers:read | Dopyt: connector?: integer[0,255] | 200 image/png binárne, 300 px, Content-Disposition: inline, Cache-Control: no-store |
GET /v2/admin/chargers/:chargerId/composite-schedules | chargers:read | Dopyt: cursor?, limit?=20 (1..50), connectorId? | 200 { items: CompositeSchedule[], nextCursor: number or null } |
GET /v2/admin/chargers/:chargerId/configuration | chargers:read | Telo/dopyt: žiadne | 200 { items: ChargerConfiguration[] }; hodnoty podobné tajomstvám sú [REDACTED] |
PATCH /v2/admin/chargers/:chargerId/configuration | chargers:configuration | Telo: { key: string(1..50), value: string(0..500) } | 200 { status: string }, kde stav je výsledkom nabíjačky/OCPP |
POST /v2/admin/chargers/:chargerId/configuration/reload | chargers:configuration | Telo: žiadne | 200 { status: string } |
GET /v2/admin/chargers/:chargerId/firmware | chargers:read | Telo/dopyt: žiadne | 200 { firmware: { status, notifiedAt, currentVersion, bootNotifiedAt } } |
POST /v2/admin/chargers/:chargerId/firmware | chargers:firmware | Telo: { url: HTTP-or-HTTPS URL, max 2048 characters } | 202 { status: string } |
POST /v2/admin/chargers/:chargerId/commands/reset | chargers:commands | Telo: { resetType: "Soft" or "Hard" } | 200 { status: string } |
POST /v2/admin/chargers/:chargerId/commands/availability | chargers:commands | Telo: { availabilityType: "Operative" or "Inoperative" } | 200 { status: string } |
POST /v2/admin/chargers/:chargerId/commands/trigger | chargers:commands | Telo: { messageType: "BootNotification", "Heartbeat", "StatusNotification", or "MeterValues" } | 200 { status: string, connectorResults: { connectorId, status }[] } |
POST /v2/admin/chargers/:chargerId/commands/unlock | chargers:commands | Telo: { connectorId: positive integer } | 200 { status: string } |
POST /v2/admin/chargers/:chargerId/commands/composite-schedule | chargers:commands | Telo: { connectorId: nonnegative integer, durationSeconds?: integer[60,604800], chargingRateUnit?: "W" or "A" } | 200 { status: string, connectorId: number, compositeSchedule: CompositeSchedule or null } |
Koncové body výkazov
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/reports/data | reports:read | Dopyt: ReportFilters, nepriehľadný cursor?, limit?=50 (1..100) | 200 { items: ReportSession[], pageTotals, page { limit, nextCursor }, range { from, to, toExclusive: true } } |
GET /v2/admin/reports/schedule | reports:read | Telo/dopyt: žiadne | 200 { schedule: ReportSchedule or null } |
PUT /v2/admin/reports/schedule | reports:schedules | Telo: prísna schéma ReportScheduleInput | 200 { schedule: ReportSchedule } |
POST /v2/admin/reports/send | reports:send | Telo: žiadne; vyžaduje sa hlavička Idempotency-Key | 200 { sent: true, format: "csv" or "pdf", rowCount: number, range { from, to } }; ak nie je uložený harmonogram, vráti 409 REPORT_SCHEDULE_REQUIRED |
GET /v2/admin/reports/measurements | reports:read | Dopyt: povinné transactionLogId, nepriehľadný cursor?, limit?=500 (1..1000) | 200 { transactionLogId, measurements: { name, unit, lines[] }[], page { limit, nextCursor, sampleValuesTruncated, sampleLimitPerMeterValue: 64 } } |
GET /v2/admin/reports/export | reports:export | Dopyt: ReportFilters, format?="csv" or "pdf" | 200 binárne CSV/PDF s názvom súboru prílohy, Cache-Control: private, no-store, X-Content-Type-Options: nosniff; viac než 2 000 riadkov vráti 422 REPORT_EXPORT_ROW_LIMIT |
Koncové body taríf
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/tariffs | tariffs:read | Telo/dopyt: žiadne | 200 { items: Tariff[], lookups { currencies, biddingZones, currencyRates, componentTypes, seasons, tariffTypes } } |
POST /v2/admin/tariffs | tariffs:create | Telo: TariffInput | 201 { tariff: Tariff } |
GET /v2/admin/tariffs/:tariffId | tariffs:read | Telo/dopyt: žiadne | 200 { tariff: Tariff, lookups } |
PATCH /v2/admin/tariffs/:tariffId | tariffs:update | Telo: úplné TariffInput | 200 { tariff: Tariff } |
PUT /v2/admin/tariffs/:tariffId/components | tariffs:components | Telo: { components: TariffComponentInput[0..256] } | 200 { tariff: Tariff, components: TariffComponent[] } |
DELETE /v2/admin/tariffs/:tariffId | tariffs:delete | Telo: žiadne | 204 empty; odkazy zo záznamov nabíjania vracajú 409 TARIFF_CONFLICT |
GET /v2/admin/tariffs/:tariffId/market-prices | tariffs:read | Dopyt: povinné startsAt, nezáporná časová pečiatka Unix | 200 { items: { id, value, currencyId, startsAt, endsAt, startsAtIso, endsAtIso, intervalMinutes }[], truncated: boolean }; najviac 10 000 riadkov |
GET /v2/admin/chargers/:chargerId/tariff-assignments | chargers:tariff-assignments + tariffs:read | Telo/dopyt: žiadne | 200 { items: TariffAssignment[], tariffs: Tariff[] } |
POST /v2/admin/chargers/:chargerId/tariff-assignments | chargers:tariff-assignments + tariffs:assign | Telo: TariffAssignmentCreateInput; vynechané connectorId alebo connectorId=0 znamená všetky konektory | 201 { assignments: TariffAssignment[] } |
PATCH /v2/admin/chargers/:chargerId/tariff-assignments/:assignmentId | chargers:tariff-assignments + tariffs:assign | Telo: TariffAssignmentUpdateInput; konektor je povinný a nemôže byť 0 | 200 { assignment: TariffAssignment } |
DELETE /v2/admin/chargers/:chargerId/tariff-assignments/:assignmentId | chargers:tariff-assignments + tariffs:assign | Telo: žiadne | 204 empty |
TariffAssignment obsahuje id, chargerId, connectorId, bezpečný súhrn tarify/meny, createdAt a updatedAt.
Koncové body nabíjacích profilov
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/charging-profiles | chargingProfiles:read | Telo/dopyt: žiadne | 200 { items: ChargingProfile[], lookups { locations, purposes, kinds, recurrencyKinds, rateUnits, allowedRateUnits } } |
POST /v2/admin/charging-profiles | chargingProfiles:create | Telo: ChargingProfileCreate | 201 { profile: ChargingProfile } |
GET /v2/admin/charging-profiles/:profileId | chargingProfiles:read | Telo/dopyt: žiadne | 200 { profile: ChargingProfile, lookups, isEditBlocked: boolean, usage { simpleChargingSchedule, smartSchedule, chargePoolChargepoint, isUsed } } |
PATCH /v2/admin/charging-profiles/:profileId | chargingProfiles:update | Telo: úplné ChargingProfileInput | 200 { profile: ChargingProfile, ocppSync: OcppCommandResult[] } |
PUT /v2/admin/charging-profiles/:profileId/schedule | chargingProfiles:update | Telo: ChargingScheduleInput | 200 { profile: ChargingProfile, schedule: SchedulePeriod[], ocppSync: OcppCommandResult[] } |
DELETE /v2/admin/charging-profiles/:profileId | chargingProfiles:delete | Telo: žiadne | 204 empty až po prijatí vymazania všetkými priradenými nabíjačkami a opätovnom overení stavu; inak 409 a profil zostáva |
GET /v2/admin/chargers/:chargerId/profile-assignments | chargers:profile-assignments + chargingProfiles:read | Telo/dopyt: žiadne | 200 { items: ProfileAssignment[], profiles: ChargingProfile[] } |
POST /v2/admin/chargers/:chargerId/profile-assignments | chargers:profile-assignments + chargingProfiles:assign | Telo: ProfileAssignmentInput | 201 { assignment: ProfileAssignment, ocpp: OcppCommandResult } |
PATCH /v2/admin/chargers/:chargerId/profile-assignments/:assignmentId | chargers:profile-assignments + chargingProfiles:assign | Telo: ProfileAssignmentInput | 200 { assignment: ProfileAssignment, ocpp: OcppCommandResult } |
DELETE /v2/admin/chargers/:chargerId/profile-assignments/:assignmentId | chargers:profile-assignments + chargingProfiles:assign | Telo: žiadne | 204 empty po synchronizovanom vymazaní |
ProfileAssignment obsahuje ID priradenia, ID nabíjačky/konektora a bezpečný súhrn profilu. Objekty výsledkov OCPP sprístupňujú stabilné údaje o požiadavke/stave a nikdy prihlasovacie údaje.
Koncové body používateľov, RFID, prístupu, limitov a lokálnych používateľov
| Metóda a cesta | Rozsah oprávnení | Požiadavka | Úspešná odpoveď |
|---|---|---|---|
GET /v2/admin/users | users:read | Dopyt: cursor? zodpovedajúce stavu (members: kladné číselné; invitations: autentifikovaný nepriehľadný i2.*; all: číselné pokračovanie staršieho toku členov alebo autentifikovaný nepriehľadný zložený a2.*), limit?=50 (1..100), status?="all", "members", or "invitations"; voliteľná hlavička X-Admin-User-Search (najviac 100) | 200 { items: User[], invitations: Invitation[], chargers: ChargerSummary[], page { nextCursor, memberNextCursor, invitationNextCursor, limit } }; pozvánky sa stránkujú a dopĺňajú údajmi pomocou rovnakého výrazu normalizovaného e-mailu, aby staršie rozdiely vo veľkosti písmen alebo medzerách nemohli skryť riadky; kurzory sú viazané na pracovný priestor a filter vyhľadávania, neobsahujú čitateľnú e-mailovú adresu a musia sa vracať nezmenené; kurzory all posúvajú toky členov a pozvánok nezávisle |
POST /v2/admin/users | users:create | Telo: UserCreate; zákazník už musí byť registrovaný | 201 { user: User }; neznámy e-mail vráti telo 404 RESOURCE_NOT_FOUND, ktoré neodhaľuje existenciu zdroja, a mal by používať pozvánky |
POST /v2/admin/users/invitations | users:invitations + users:access; navyše users:rfid, ak sa zadá rfid | Telo: InvitationInput | 200 or 201 { result }; výsledok pripojenia je { kind:"attached", user, accessChanged, rfidChanged }; čakajúci výsledok je { kind:"invited", email, name, maskedRfid, chargerIds, createdCount, emailSent, emailRetryReady, alreadyInvited } |
POST /v2/admin/users/invitations/resend | users:invitations | Telo: { email: email } | 200 { result: { targetedChargers, emailSent, emailRetryReady } }; vynucuje sa spoločný odstup doručovania príjemcovi naprieč zdrojmi požiadaviek |
DELETE /v2/admin/users/invitations | users:invitations | Telo: { email: email } | 204 empty |
GET /v2/admin/users/:userId | users:read + reports:read | Telo/dopyt: žiadne | 200 { user: UserDetail, sessions: UserSession[], totals { count, energyWh, durationSeconds }, window, limitTypes, chargers }; najviac 200 relácií za 90 dní |
PATCH /v2/admin/users/:userId | users:update | Telo: { name: string(1..255) } | 200 { user: User } |
DELETE /v2/admin/users/:userId | users:delete | Telo: žiadne | 204 empty |
GET /v2/admin/users/:userId/vehicles | users:read | Dopyt: číselné cursor?, limit?=50 (1..100) | 200 { items: Vehicle[], page { nextCursor, limit } }; DTO vozidla obsahuje bezpečné polia poskytovateľa/stavu/modelu/telemetrie |
GET /v2/admin/users/:userId/rfids | users:read | Telo/dopyt: žiadne | 200 { items: RFID[] }; UID sú maskované |
POST /v2/admin/users/:userId/rfids | users:rfid | Telo: { uid: string(1..36), name?: string or null } | 201 { rfid: RFID }; nespracované UID sa nevracia v odpovedi |
PATCH /v2/admin/users/:userId/rfids/:rfidId | users:rfid | Telo: { name: string or null } | 200 { rfid: RFID } |
DELETE /v2/admin/users/:userId/rfids/:rfidId | users:rfid | Telo: žiadne | 204 empty |
GET /v2/admin/users/:userId/access | users:read | Telo/dopyt: žiadne | 200 { access: Access } |
PUT /v2/admin/users/:userId/access | users:access | Telo: AccessInput | 200 { access: Access } |
DELETE /v2/admin/users/:userId/access/:accessId | users:access | Telo: žiadne | 204 empty |
GET /v2/admin/users/:userId/limits | users:read | Telo/dopyt: žiadne | 200 { items: Limit[] } |
POST /v2/admin/users/:userId/limits | users:limits | Telo: LimitCreate | 201 { limit: Limit } |
PATCH /v2/admin/users/:userId/limits/:limitId | users:limits | Telo: LimitPatch, aspoň jedna vlastnosť | 200 { limit: Limit } |
DELETE /v2/admin/users/:userId/limits/:limitId | users:limits | Telo: žiadne | 204 empty |
GET /v2/admin/chargers/:chargerId/local-users | chargers:read + users:read | Telo/dopyt: žiadne | 200 { charger: ChargerSummary, items: LocalUser[], invitations: { email }[], availableMembers: [] }; API zámerne vynecháva široký adresár dostupných členov portálu |
POST /v2/admin/chargers/:chargerId/local-users | chargers:local-users + users:access | Telo: { customerId: positive integer, expiresAt?: RFC3339 or null } | 201 { localUser: LocalUserMutation } |
POST /v2/admin/chargers/:chargerId/local-users/invitations | chargers:local-users + users:invitations + users:access | Telo: { email: email } | 200 or 201 { result }; existujúci zákazník: { invited:false, localUser: LocalUserMutation }; pozvánka: { invited:true, alreadyInvited, emailSent, emailRetryReady } |
DELETE /v2/admin/chargers/:chargerId/local-users/invitations | chargers:local-users + users:invitations | Telo: { email: email } | 204 empty |
PATCH /v2/admin/chargers/:chargerId/local-users/:localUserId | chargers:local-users + users:access | Telo: { expiresAt: RFC3339 or null } | 200 { localUser: LocalUserUpdate } |
DELETE /v2/admin/chargers/:chargerId/local-users/:localUserId | chargers:local-users + users:access | Telo: žiadne | 204 empty |
Systémový používateľ Tagless je pred týmito operáciami chránený. Zlyhania odoslania pozvánky e-mailom vracajú bezpečný stav doručenia bez odhalenia podrobností SMTP; volajúci môžu skúsiť znova, keď má emailRetryReady hodnotu true.
Binárne odpovede
Dve skupiny koncových bodov pri úspechu nevracajú JSON:
| Koncový bod | Typ obsahu | Dôležité hlavičky |
|---|---|---|
| QR nabíjačky | image/png | Cache-Control: no-store, Content-Disposition: inline, X-Content-Type-Options: nosniff |
| Export výkazu | text/csv; charset=utf-8 alebo application/pdf | Cache-Control: private, no-store, Content-Disposition: attachment, X-Content-Type-Options: nosniff |
Chyby binárnych koncových bodov sú stále vo formáte JSON.