API-Dokumentation Webhosting für alle LWS besuchen

Kauf eines Hostings/einer Domain

Verzögert Kostenpflichtige Aktion

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

operationIdpostHostingBuy

Kauft eine Domain oder ein Hosting für Ihr Konto. 'package' ist der Name des zu kaufenden Hostings (wählen Sie 'domaine', um nur die Domain zu kaufen).

Diese Anfrage wird im Hintergrund verarbeitet: Sie antwortet sofort, während die Arbeit weiterläuft. Verfolgen Sie sie über die Task- oder Request-Endpunkte.

Diese Aktion ist kostenpflichtig. Ihr Prepaid-Konto wird belastet.

Anfrage-Body

  • package string

    Welches Hosting unter allen LWS-Hostings gekauft werden soll

    Beispiel: LWS Perso

    optional
  • domain string

    Domainname, dem das Hosting zugeordnet werden soll

    Beispiel: example.com

    optional
  • owner integer

    Inhaber des Hostings

    Beispiel: 565487

    optional
  • type string

    Alle Optionen kaufen das ausgewählte Hosting. 'buy' kauft zusätzlich die Domain; 'host' kauft nur das Hosting, sofern Sie die Domain bereits besitzen; 'transfer' überträgt eine bestehende Domain von einem anderen Registrar zu LWS.

    Beispiel: buy

    optional
  • period integer

    Laufzeit des Hostings

    Beispiel: 12

    optional
Beispielanfrage
{
  "package": "LWS Perso",
  "domain": "example.com",
  "owner": 565487,
  "type": "buy",
  "period": 12
}

Antworten

200

Hosting erfolgreich erstellt

{
  "code": 200,
  "info": "Your domain example.com has been bought with the hosting LWS Perso.",
  "data": []
}
Felder der Antwort 3
  • code integer

    Beispiel: 200

  • info string

    Beispiel: Your domain example.com has been bought with the hosting LWS Perso.

  • data object
400

Ungültige Eingabe

{
  "code": 400,
  "info": {
    "domain": "Required field"
  },
  "data": {
    "domain": "/^(?!-)([A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,15}$/"
  }
}
Felder der Antwort 3
  • code integer

    Beispiel: 400

  • info object

    Beispiel: {"domain":"Required field"}

  • data object

    Beispiel: {"domain":"/^(?!-)([A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,15}$/"}

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": "Error message"
}
Felder der Antwort 3
  • code integer

    Beispiel: 500

  • info string

    Beispiel: Internal Server Error

  • data string

    Beispiel: Error message

502

Ungültiges Gateway

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Felder der Antwort 3
  • code integer

    Beispiel: 502

  • info string

    Beispiel: Invalid response from upstream server

  • data object
Codebeispiele und Testkonsole anzeigen
POST /hosting
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X POST \  "https://api.lws.net/v1/hosting" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"package":"LWS Perso","domain":"example.com","owner":565487,"type":"buy","period":12}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting");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, '{"package":"LWS Perso","domain":"example.com","owner":565487,"type":"buy","period":12}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.post(    "https://api.lws.net/v1/hosting",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"package": "LWS Perso", "domain": "example.com", "owner": 565487, "type": "buy", "period": 12},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting", {  method: "POST",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"package":"LWS Perso","domain":"example.com","owner":565487,"type":"buy","period":12}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"package":"LWS Perso","domain":"example.com","owner":565487,"type":"buy","period":12}`)req, _ := http.NewRequest("POST",    "https://api.lws.net/v1/hosting", 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)