test
import requests
from requests.exceptions import RequestException
# URL und Endpunkt für die Registrierung
url = „https://plattform.universal-living.de/api/portal-identityserver/api/v1/registration/unified-account“
# Header für die Anfrage
headers = {
„Content-Type“: „application/json“,
„Accept-Language“: „de“
}
# Daten für den Body der Anfrage
data = {
„firstName“: „Max“,
„lastName“: „Musterman“,
„email“: „max@muster.de“,
„password“: „password“,
„acceptedTermsAndConditions“: True,
„domainRegisteredOn“: „URL“,
„accountActivationUrl“: „https://plattform.universal-living.de/site/account/activation/{code}?language={language}“,
„linkId“: „“
}
try:
# Senden der POST-Anfrage
response = requests.post(url, json=data, headers=headers)
response.raise_for_status() # Löst eine Exception aus, wenn die Anfrage fehlschlägt
# Überprüfen der Antwort
if response.json().get(‚hasErrors‘, True):
print(„Fehler bei der Registrierung:“, response.json().get(‚errorFields‘, []))
else:
print(„Registrierung erfolgreich!“)
except RequestException as e:
print(„Ein Fehler ist aufgetreten:“, e)