Zum Hauptinhalt springen
Version: API v1

Login über eine der Zugriffsmöglichkeiten

POST/v1/authenticate
API-Version
v1
Request-Methode
POST
Operation-ID
authenticate

Diese Operation liefert bei erfolgreichem Login ein access_token aus. Es kann ein zweiter Faktor notwendig sein. Dieser kann per TOTP generiert werden oder per E-Mail empfangen werden. Im letzten Fall muss dann zusätzlich eine Device-ID mitgeschickt.

Request​

Responses​

Format
application/json
Beschreibung

Login Token und Ablaufzeitpunkt

  • tokenstringrequired

    Das API-Token

  • expiresstring (datetime)required

    Ablaufzeitpunkt des Tokens

Content-Type: application/json

{
"token": "string",
"expires": "string"
}
{
"title": "AuthenticationResponse",
"required": [
"expires",
"token"
],
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "Das API-Token",
"readOnly": true
},
"expires": {
"type": "string",
"description": "Ablaufzeitpunkt des Tokens",
"format": "datetime",
"readOnly": true
}
}
}

Format
application/json
Beschreibung

Login ist nicht fehlerhalft, erfordert aber einen weiteren Faktor

  • namestring (einer von: TOTP, DeviceCookie)required
  • deviceIdstringrequired
Content-Type: application/json

{
"name": "TOTP",
"deviceId": "string"
}
{
"title": "AuthenticationIncompleteResponse",
"type": "object",
"required": [
"name",
"deviceId"
],
"properties": {
"name": {
"type": "string",
"enum": [
"TOTP",
"DeviceCookie"
]
},
"deviceId": {
"type": "string"
}
}
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"username":"string","password":"string","multiFactorCode":"string","deviceId":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v1/authenticate

Auf dieser Seite