GET
/api/v1/accounts
Informationen zum authentifizierten Account liefern (z.B. hinterlegte Daten, verfügbare Credits)
Autorisierung
notwendig
Antwort-Status
{
"remote-ip": "127.0.0.1",
"status": "OK",
"account": {
"email": "name@example.com",
"date_create": "2025-01-01 00:00:00",
"name": "",
"company": "",
"address_1": "",
"address_2": "",
"zip": "",
"city": "",
"country": "",
"vat": ""
},
"credits": {
"total": "200",
"remaining": "123",
"valid_from": "2025-01-01",
"valid_until": "2025-01-31"
}
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Unauthorized"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authentication required"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authorization malformatted"
}
POST
/api/v1/accounts
Erzeugt einen neuen Account. Der generierte API-Key wird per E-Mail an die übergebene Adresse gesendet.
TODO: Der Versand der Mail mit dem API-Key ist noch nicht funktional, da hier Optik und Texte fehlen.
Autorisierung
nicht notwendig
Parameter
| Name | Typ | Beschreibung |
|---|---|---|
| string | gültige E-Mail-Adresse, der generierte API-Key wird an diese Adresse gesendet | |
| secret | string | vom Client erzeugte beliebige Zeichenkette (z.B. SHA256-Hash), das Secret muss auf Clientseite gespeichert werden und mit jedem API-Aufruf, der Authentifizierung erfordert, zusammen mit dem API-Key gesendet werden |
Beispiel
{
"email": "name@example.com",
"secret": "3fe9914f7f2ccfdfef120d30985e2aa9eda65d382a61ecc59c5fd4ed045a8873"
}
Antwort-Status
{
"remote-ip": "127.0.0.1",
"status": "OK",
"message": "account created"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "submitted data is not valid JSON"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "invalid email domain for \"name@unknown.ext\""
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "missing parameter: [email]"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Too many Requests",
"details": {
"max_keys_per_account": 3
}
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "error sending key email"
}
PUT
/api/v1/accounts
Account aktivieren, dies sollte der erste Aufruf mit einem neu hinterlegten API-Key sein
Autorisierung
notwendig
Antwort-Status
{
"remote-ip": "127.0.0.1",
"status": "OK",
"message": "Account activated",
"account": {
"email": "name@example.com",
"date_create": "2025-01-01 00:00:00",
"name": "",
"company": "",
"address_1": "",
"address_2": "",
"zip": "",
"city": "",
"country": "",
"vat": ""
},
"credits": {
"total": "200",
"remaining": "200",
"valid_from": "2025-01-01",
"valid_until": "2025-01-31"
}
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Unauthorized"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authentication required"
}
{
"remote-ip": "127.0.0.1",
"status": "Error",
"message": "Authorization malformatted"
}