Zum Inhalt springen

API-Referenz

Jede Operation des veröffentlichten Vertrags, mit Playground und Codebeispielen.

Die Referenz wird beim Bau dieser Seiten aus dem veröffentlichten Vertrag der Integrations-API erzeugt (OpenAPI 3.0). Sie zeigt genau die Operationen, die ein API-Schlüssel oder ein öffentlicher Aufruf nutzen kann; die Operationen des Portals sind nicht Teil davon (siehe Stabilität und Versionen).

Grundlagen

Basis-URLhttps://<Ihre BatteryPass-Adresse>/api/v1 (siehe Umgebungen)
AuthentifizierungAuthorization: Bearer bp_live_… mit Scope read, condition oder import (Authentifizierung)
FormatJSON, Zeitpunkte in UTC, IDs als UUID
FehlerProblem Details nach RFC 9457 mit stabilem code (Fehler)
ListenKeyset-Paginierung mit limit und cursor (Paginierung)
Grenzen429 rate_limited mit Retry-After (Ratenlimits)

Playground

Jede Operationsseite hat einen Playground („Try in Playground“). Er sendet die Anfrage aus Ihrem Browser an die BatteryPass-Instanz, auf der diese Dokumentation läuft. Ihr Schlüssel bleibt nur in diesem Tab (sessionStorage) und wird ohne Cookies gesendet; nutzen Sie dafür einen Schlüssel mit Scope read.

Vertrag herunterladen

  • openapi.json und openapi.yaml: der Stand, aus dem diese Dokumentation gebaut wurde.
  • /api/v1/openapi.json und /api/v1/openapi.yaml auf Ihrer BatteryPass-Adresse: der Stand, den Ihre Instanz gerade ausliefert.

Alle Operationen

Katalog

OperationAnfrageScope
Units (individual batteries) of the active organisationGET /batteriesread
The units as a spreadsheet with the import's columnsGET /batteries/exportread
A unitGET /batteries/{batteryId}read
List the battery models of the active organisationGET /battery-modelsread
A battery modelGET /battery-models/{modelId}read
Versions of a battery model, newest effective date firstGET /battery-models/{modelId}/versionsread
A model versionGET /model-versions/{versionId}read

Werte

OperationAnfrageScope
Registry evaluation of the unit-level fieldsGET /batteries/{batteryId}/completenessread
Current unit-level values of a unitGET /batteries/{batteryId}/valuesread
All revisions of one unit-level value, newest firstGET /batteries/{batteryId}/values/{fieldKey}/historyread
Registry evaluation of the model-level fieldsGET /model-versions/{versionId}/completenessread
Current model-level values of a versionGET /model-versions/{versionId}/valuesread
All revisions of one model-level value, newest firstGET /model-versions/{versionId}/values/{fieldKey}/historyread

Nachweise

OperationAnfrageScope
The evidence library, newest firstGET /evidenceread
One document with its revisions and where it is usedGET /evidence/{evidenceId}read
Download the fileGET /evidence/{evidenceId}/downloadread

Pässe

OperationAnfrageScope
The passport of a unitGET /batteries/{batteryId}/passportread
The QR code of the unit's GS1 Digital LinkGET /batteries/{batteryId}/passport/qrread
The passport's registration with the EU registryGET /batteries/{batteryId}/passport/registrationread
The published versions of a unit's passport, newest firstGET /batteries/{batteryId}/passport/versionsread
One published version with its signed snapshot and validation reportGET /batteries/{batteryId}/passport/versions/{versionNo}read
The BatteryPass v2.0 export of a version (all tiers)GET /batteries/{batteryId}/passport/versions/{versionNo}/batterypass-v2read
What changed from an earlier version to this oneGET /batteries/{batteryId}/passport/versions/{versionNo}/diffread
A PDF of a version with every tier, restricted rows tagged, the signature and the QR codeGET /batteries/{batteryId}/passport/versions/{versionNo}/pdfread

Lebenszyklus

OperationAnfrageScope
The condition data of a unit (the registry's dynamic fields)GET /batteries/{batteryId}/conditionread
Report measured condition data (merge)PATCH /batteries/{batteryId}/conditioncondition
The lifecycle of a unit, newest firstGET /batteries/{batteryId}/lifecycle-eventsread
Record an event in the life of a unitPOST /batteries/{batteryId}/lifecycle-eventscondition

Feldregister

Standorte

OperationAnfrageScope
Manufacturing facilities of the active organisationGET /facilitiesread

Öffentlich

OperationAnfrageScope
The public passport of a unit, looked up by GTIN and serial numberGET /public/dpps/by-product-id/{productId}public
The public passport (current version)GET /public/passports/{passportId}public
A public document of a public passportGET /public/passports/{passportId}/documents/{documentId}public
Check the signatures of a version on the serverGET /public/passports/{passportId}/verifypublic
The public passport as it was at a point in timeGET /public/passports/{passportId}/versionpublic

Änderungen

OperationAnfrageScope
The organisation's changes, oldest first, for pollingGET /changesread

Importe

OperationAnfrageScope
Imports of the active organisation, newest firstGET /importsimport
Upload a spreadsheet of unitsPOST /importsimport
One import with its mapping and summaryGET /imports/{importId}import
Map the columns of an importPUT /imports/{importId}/mappingimport
Start validating every row of an importPOST /imports/{importId}/validateimport