Aller au contenu
Référence API

QR-Codes

6 endpoints

Les descriptions des endpoints proviennent directement de l'API et sont en allemand.

QR-Codes auflisten

get/v1/codes

Statische QR-Codes mit URL und Anzahl Scans.

Réponse 200CodeList

NomTypeDescription
objectobligatoire"list"
dataobligatoireCode[]
has_moreobligatoireboolean

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/codes \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "object": "list",
  "data": [
    {
      "id": "qr_3c9a1e7b0d2f4a6c",
      "object": "code",
      "code": "k7m2p9x",
      "target": "connector",
      "connector_id": "string",
      "location_id": "string",
      "label": "string",
      "url": "https://hof-meier.ladehase.com/k7m2p9x",
      "display_url": "string",
      "scans": 0,
      "disabled": true,
      "created_at": "string"
    }
  ],
  "has_more": true
}

QR-Code anlegen

post/v1/codes

Für einen Ladepunkt oder einen ganzen Standort (Auswahl auf der Bezahlseite).

Paramètres

NomEmplacementType
idempotency-keyfacultatifWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)En-têtestring

Requête

NomTypeDescription
targetobligatoire"connector" | "location"
connector_idfacultatifstring
location_idfacultatifstring
labelfacultatifstring

Réponse 201Code

NomTypeDescription
idobligatoirestringID mit Präfix «qr_»
objectobligatoire"code"
codeobligatoirestringKurzcode auf dem Schild
targetobligatoire"connector" | "location"
connector_idobligatoirestring | null
location_idobligatoirestring | null
labelobligatoirestring | null
urlobligatoirestring
display_urlobligatoirestring
scansobligatoireinteger
disabledobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X POST https://api.ladehase.com/v1/codes \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"target":"connector","connector_id":"string","location_id":"string","label":"string"}'
Réponse 201
{
  "id": "qr_3c9a1e7b0d2f4a6c",
  "object": "code",
  "code": "k7m2p9x",
  "target": "connector",
  "connector_id": "string",
  "location_id": "string",
  "label": "string",
  "url": "https://hof-meier.ladehase.com/k7m2p9x",
  "display_url": "string",
  "scans": 0,
  "disabled": true,
  "created_at": "string"
}

QR-Code abrufen

get/v1/codes/{id}

Ein QR-Code.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Réponse 200Code

NomTypeDescription
idobligatoirestringID mit Präfix «qr_»
objectobligatoire"code"
codeobligatoirestringKurzcode auf dem Schild
targetobligatoire"connector" | "location"
connector_idobligatoirestring | null
location_idobligatoirestring | null
labelobligatoirestring | null
urlobligatoirestring
display_urlobligatoirestring
scansobligatoireinteger
disabledobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/codes/{id} \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "id": "qr_3c9a1e7b0d2f4a6c",
  "object": "code",
  "code": "k7m2p9x",
  "target": "connector",
  "connector_id": "string",
  "location_id": "string",
  "label": "string",
  "url": "https://hof-meier.ladehase.com/k7m2p9x",
  "display_url": "string",
  "scans": 0,
  "disabled": true,
  "created_at": "string"
}

QR-Code ändern

patch/v1/codes/{id}

Bezeichnung ändern oder deaktivieren.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Requête

NomTypeDescription
labelfacultatifstring
disabledfacultatifboolean

Réponse 200Code

NomTypeDescription
idobligatoirestringID mit Präfix «qr_»
objectobligatoire"code"
codeobligatoirestringKurzcode auf dem Schild
targetobligatoire"connector" | "location"
connector_idobligatoirestring | null
location_idobligatoirestring | null
labelobligatoirestring | null
urlobligatoirestring
display_urlobligatoirestring
scansobligatoireinteger
disabledobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X PATCH https://api.ladehase.com/v1/codes/{id} \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"label":"string","disabled":true}'
Réponse 200
{
  "id": "qr_3c9a1e7b0d2f4a6c",
  "object": "code",
  "code": "k7m2p9x",
  "target": "connector",
  "connector_id": "string",
  "location_id": "string",
  "label": "string",
  "url": "https://hof-meier.ladehase.com/k7m2p9x",
  "display_url": "string",
  "scans": 0,
  "disabled": true,
  "created_at": "string"
}

QR-Code als SVG

get/v1/codes/{id}/qr.svg

Mit Bildmarke in der Mitte.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/codes/{id}/qr.svg \n  -H "Authorization: Bearer lh_test_…"

QR-Code als PNG

get/v1/codes/{id}/qr.png

1024 × 1024 Pixel.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/codes/{id}/qr.png \n  -H "Authorization: Bearer lh_test_…"