Documentation API L’hébergement web accessible à tous Visiter LWS

Obtenir tous les hébergements et domaines

GET https://api.lws.net/v1/hosting/0/list

operationIdgetHosting0List

Récupère la liste de tous les domaines et de leurs hébergements associés gérés par l'utilisateur, ainsi que diverses informations les concernant.

Réponses

200

Hébergements récupérés avec succès

{
  "code": 200,
  "info": "Retrieved all hostings",
  "data": [
    {
      "domain": "example.com",
      "date_purchase": "2023-01-01",
      "date_expiration": "2024-01-01",
      "ns1": "ns1.lwsdns.com",
      "ns2": "ns2.lwsdns.com",
      "ns3": "ns3.lwsdns.com",
      "ns4": "ns4.lwsdns.com",
      "owner": 547645,
      "package": "LWS Perso",
      "lws_domain": true,
      "autorenew": {
        "payment": "aucun",
        "account": ""
      }
    }
  ]
}
Champs de la réponse 16
  • code integer

    Exemple: 200

  • info string

    Exemple: Retrieved all hostings

  • data object[]
  • domain any

    Nom du domaine

    Exemple: example.com

  • date_purchase any

    Date d'achat de l'hébergement

    Exemple: 2023-01-01

  • date_expiration any

    Date d'expiration de l'hébergement

    Exemple: 2024-01-01

  • ns1 any

    Premier serveur de noms

    Exemple: ns1.lwsdns.com

  • ns2 any

    Second serveur de noms

    Exemple: ns2.lwsdns.com

  • ns3 any

    Troisième serveur de noms

    Exemple: ns3.lwsdns.com

  • ns4 any

    Quatrième serveur de noms

    Exemple: ns4.lwsdns.com

  • owner any

    Propriétaire de l'hébergement

    Exemple: 547645

  • package any

    Type de forfait d'hébergement

    Exemple: LWS Perso

  • lws_domain any

    Indique si le domaine a été acheté chez LWS.fr ou non

    Exemple: true

  • autorenew object

    Informations sur le renouvellement automatique du domaine

  • payment string

    Exemple: aucun

  • account string

    Exemple:

400

Requête incorrecte

{
  "code": 400,
  "info": "Invalid request",
  "data": []
}
Champs de la réponse 3
  • code integer

    Exemple: 400

  • info string

    Exemple: Invalid request

  • data any[]
401

Non autorisé - En-têtes d'authentification manquants

{
  "code": 401,
  "info": "Unauthorized access to the API. Please specify X-Auth-Pass and X-Auth-Login to proceed."
}
Champs de la réponse 2
  • code integer

    Exemple: 401

  • info string

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

429

Limite de requêtes dépassée

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Champs de la réponse 2
  • code integer

    Exemple: 429

  • info string

    Exemple: Rate limit exceeded. Please try again later.

500

Erreur interne du serveur

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Error message"
}
Champs de la réponse 3
  • code integer

    Exemple: 500

  • info string

    Exemple: Internal Server Error

  • data string

    Exemple: Error message

502

Passerelle incorrecte

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Champs de la réponse 3
  • code integer

    Exemple: 502

  • info string

    Exemple: Invalid response from upstream server

  • data object
Afficher les exemples de code et la console de test
GET /hosting/0/list
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X GET \  "https://api.lws.net/v1/hosting/0/list" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS"
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/hosting/0/list");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HTTPHEADER, [    "X-Auth-Login: " . $lwsAuthLogin,    "X-Auth-Pass: " . $lwsAuthPass,]);$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.get(    "https://api.lws.net/v1/hosting/0/list",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/hosting/0/list", {  method: "GET",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,  },});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"req, _ := http.NewRequest("GET",    "https://api.lws.net/v1/hosting/0/list", nil)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)resp, err := http.DefaultClient.Do(req)