API-Dokumentation Webhosting für alle LWS besuchen

Informationen eines bestehenden Kontakts aktualisieren

PUT https://api.lws.net/v1/contact/{contact}

operationIdputContact

Aktualisiert die Informationen eines bestehenden Kontakts. Es werden nur die angegebenen Felder aktualisiert.

Pfadparameter

contact integer erforderlich

ID des zu aktualisierenden Kontakts

Anfrage-Body

  • 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
  • password any

    Passwort

    Beispiel: password

    optional
Beispielanfrage
{
  "address": "1 rue de la Paix",
  "postal": "75000",
  "city": "Paris",
  "country": "FR",
  "phone": "0033612345678",
  "password": "password"
}

Antworten

200

Kontakt erfolgreich aktualisiert

{
  "code": 200,
  "info": "Updated contact information",
  "data": {
    "address": "1 rue de la Paix",
    "postal": "75000",
    "city": "Paris",
    "country": "FR",
    "phone": "0033612345678",
    "password": "password"
  }
}
Felder der Antwort 9
  • code integer

    Beispiel: 200

  • info string

    Beispiel: Updated contact information

  • data object
  • address any

    Straße und Hausnummer

    Beispiel: 1 rue de la Paix

  • postal string

    Postleitzahl

    Beispiel: 75000

  • city any

    Stadt

    Beispiel: Paris

  • country any

    Land

    Beispiel: FR

  • phone any

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

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

  • password any

    Passwort

    Beispiel: password

201

Nichts zu aktualisieren, da keine Felder angegeben wurden

{
  "code": 201,
  "info": "Nothing to update"
}
Felder der Antwort 2
  • code integer

    Beispiel: 201

  • info string

    Beispiel: Nothing to update

400

Es wurden ungültige Parameter übergeben

{
  "code": 400,
  "info": "Invalid input",
  "data": {
    "city": "Invalid field, refer to the associated regex for more details"
  }
}
Felder der Antwort 3
  • code integer

    Beispiel: 400

  • info string

    Beispiel: Invalid input

  • data object

    Beispiel: {"city":"Invalid field, refer to the associated regex for more details"}

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
PUT /contact/{contact}
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X PUT \  "https://api.lws.net/v1/contact/{contact}" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/contact/{contact}");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");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, '{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.put(    "https://api.lws.net/v1/contact/{contact}",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"address": "1 rue de la Paix", "postal": "75000", "city": "Paris", "country": "FR", "phone": "0033612345678", "password": "password"},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/contact/{contact}", {  method: "PUT",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}`)req, _ := http.NewRequest("PUT",    "https://api.lws.net/v1/contact/{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)