zurück

MAXIid API

Zwei einfache HTTPS-Endpunkte, mit denen jede App MAXIid-Nutzer authentifizieren kann. Nutzer melden sich entweder mit E-Mail + Passwort oder mit einem 12-stelligen Einmalcode an.

1. Anmeldung verifizieren

POST https://maxihub.de/api/public/maxiid/verify

Mit Passwort

curl -X POST https://maxihub.de/api/public/maxiid/verify \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","password":"…"}'

Mit Einmalcode

curl -X POST https://maxihub.de/api/public/maxiid/verify \
  -H "Content-Type: application/json" \
  -d '{"code":"ABCD-EFGH-JKLM"}'

Antwort

{
  "access_token": "mid_…",
  "expires_at": "2026-06-08T12:00:00Z",
  "user": { "id": "…", "email": "user@example.com", "display_name": null }
}

Einmalcodes werden serverseitig sofort als benutzt markiert und schlagen bei einem zweiten Versuch fehl (401 code_already_used).

2. Nutzer abrufen

GET https://maxihub.de/api/public/maxiid/me

curl https://maxihub.de/api/public/maxiid/me \
  -H "Authorization: Bearer mid_…"

Beispiel-Integration (JS)

async function loginWithMaxiid(input) {
  const res = await fetch("https://maxihub.de/api/public/maxiid/verify", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(input), // { email, password } oder { code }
  });
  if (!res.ok) throw new Error((await res.json()).error);
  return res.json();
}

Fehlercodes