API-Dokumentation Webhosting für alle LWS besuchen

Einen neuen Kontakt erstellen

POST https://api.lws.net/v1/contact

operationIdpostContact

Erstellt einen neuen, von Ihrem Konto verwalteten Kontakt, der anschließend zur Verbindung mit unseren Diensten verwendet werden kann. Wird das Firmenfeld leer gelassen, wird ein Einzelkontakt erstellt.

Anfrage-Body

  • company any

    Firmenname (optional)

    Beispiel: Meine Firma

    optional
  • lastname any

    Nachname

    Beispiel: Müller

    optional
  • firstname any

    Vorname

    Beispiel: Hans

    optional
  • address any

    Straße und Hausnummer

    Beispiel: 1 rue de la Paix

    optional
  • postal string

    Postleitzahl

    Beispiel: 75000

    optional
  • city any

    Stadt

    Beispiel: Paris

    optional
  • country any

    Land

    Beispiel: FR

    optional
  • phone any

    Telefonnummer des Kontakts im internationalen Format 00{Ländercode}{Nummer}

    Muster ^00\d{1,3}\d{6,12}$ Beispiel: 0033612345678

    optional
  • email any

    E-Mail-Adresse

    Beispiel: [email protected]

    optional
  • password any

    Passwort

    Beispiel: password

    optional
Beispielanfrage
{
  "company": "Meine Firma",
  "lastname": "Müller",
  "firstname": "Hans",
  "address": "1 rue de la Paix",
  "postal": "75000",
  "city": "Paris",
  "country": "FR",
  "phone": "0033612345678",
  "email": "[email protected]",
  "password": "password"
}

Antworten

200

Kontakt erfolgreich erstellt

{
  "code": 200,
  "info": "Contact successfully created",
  "data": "367228"
}
Felder der Antwort 3
  • code integer

    Beispiel: 200

  • info string

    Beispiel: Contact successfully created

  • data string

    ID des neu erstellten Kontakts. Damit lassen sich seine Informationen per GET abrufen

    Beispiel: 367228

400

Ungültige Parameter oder doppelter Kontakt

{
  "code": 400,
  "info": {
    "email": "Invalid email address format. Example: [email protected]",
    "phone": "Required field"
  },
  "data": {
    "email": "Email regex pattern",
    "phone": "Phone number regex pattern"
  }
}
Felder der Antwort 3
  • code integer

    Beispiel: 400

  • info object

    Beispiel: {"email":"Invalid email address format. Example: [email protected]","phone":"Required field"}

  • data object

    Beispiel: {"email":"Email regex pattern","phone":"Phone number regex pattern"}

401

Nicht autorisiert - Authentifizierungs-Header fehlen

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Felder der Antwort 2
  • code integer

    Beispiel: 401

  • info string

    Beispiel: Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed.

429

Anfragelimit überschritten

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Felder der Antwort 2
  • code integer

    Beispiel: 429

  • info string

    Beispiel: Rate limit exceeded. Please try again later.

500

Interner Serverfehler

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Details on the error"
}
Felder der Antwort 3
  • code integer

    Beispiel: 500

  • info string

    Beispiel: Internal Server Error

  • data string

    Beispiel: Details on the error

502

Es wurde eine ungültige Antwort zurückgegeben. Bedeutet in der Regel, dass die zurückgegebenen Daten nicht erwartet wurden.

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": {
    "status": 500,
    "error": "Internal Server Error"
  }
}
Felder der Antwort 3
  • code integer

    Beispiel: 502

  • info string

    Beispiel: Invalid response from upstream server

  • data any[]

    Beispiel: {"status":500,"error":"Internal Server Error"}

Codebeispiele und Testkonsole anzeigen
POST /contact
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X POST \  "https://api.lws.net/v1/contact" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"company":"Meine Firma","lastname":"Müller","firstname":"Hans","address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","email":"[email protected]","password":"password"}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/contact");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,    "Content-Type: application/json",]);curl_setopt($ch, CURLOPT_POSTFIELDS, '{"company":"Meine Firma","lastname":"Müller","firstname":"Hans","address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","email":"[email protected]","password":"password"}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.post(    "https://api.lws.net/v1/contact",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"company": "Meine Firma", "lastname": "Müller", "firstname": "Hans", "address": "1 rue de la Paix", "postal": "75000", "city": "Paris", "country": "FR", "phone": "0033612345678", "email": "[email protected]", "password": "password"},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/contact", {  method: "POST",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"company":"Meine Firma","lastname":"Müller","firstname":"Hans","address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","email":"[email protected]","password":"password"}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"company":"Meine Firma","lastname":"Müller","firstname":"Hans","address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","email":"[email protected]","password":"password"}`)req, _ := http.NewRequest("POST",    "https://api.lws.net/v1/contact", body)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)req.Header.Set("Content-Type", "application/json")resp, err := http.DefaultClient.Do(req)