API documentation Web hosting accessible to everyone Visit LWS

Get all hostings and domains

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

operationIdgetHosting0List

Get a list of all the domains and their associated hostings managed by the user, as well as miscellenous informations about them.

Responses

200

Hostings retrieved successfully

{
  "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": ""
      }
    }
  ]
}
Response fields 16
  • code integer

    Example: 200

  • info string

    Example: Retrieved all hostings

  • data object[]
  • domain any

    Name of the domain

    Example: example.com

  • date_purchase any

    Purchase date of the hosting

    Example: 2023-01-01

  • date_expiration any

    Expiration date of the hosting

    Example: 2024-01-01

  • ns1 any

    First nameserver

    Example: ns1.lwsdns.com

  • ns2 any

    Second nameserver

    Example: ns2.lwsdns.com

  • ns3 any

    Third nameserver

    Example: ns3.lwsdns.com

  • ns4 any

    Fourth nameserver

    Example: ns4.lwsdns.com

  • owner any

    Owner of the hosting

    Example: 547645

  • package any

    Hosting package type

    Example: LWS Perso

  • lws_domain any

    Whether the domain has been bought at LWS.fr or not

    Example: true

  • autorenew object

    Informations about the auto renewal of the domain

  • payment string

    Example: aucun

  • account string

    Example:

400

Bad Request

{
  "code": 400,
  "info": "Invalid request",
  "data": []
}
Response fields 3
  • code integer

    Example: 400

  • info string

    Example: Invalid request

  • data any[]
401

Unauthorized - Missing authentication headers

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

    Example: 401

  • info string

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

429

Rate limit exceeded

{
  "code": 429,
  "info": "Rate limit exceeded. Please try again later."
}
Response fields 2
  • code integer

    Example: 429

  • info string

    Example: Rate limit exceeded. Please try again later.

500

Internal Server Error

{
  "code": 500,
  "info": "Internal Server Error",
  "data": "Error message"
}
Response fields 3
  • code integer

    Example: 500

  • info string

    Example: Internal Server Error

  • data string

    Example: Error message

502

Bad Gateway

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": []
}
Response fields 3
  • code integer

    Example: 502

  • info string

    Example: Invalid response from upstream server

  • data object
Show the code examples and the test console
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)