API documentation Web hosting accessible to everyone Visit LWS

Get all contacts managed by the user

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

operationIdget0List

Retrieve an associative array [ID => {data}] of all contacts managed by the user.

Responses

200

Contact list retrieved successfully

{
  "code": 200,
  "info": "Customer list fetched",
  "data": [
    [
      {
        "company": "My Company",
        "lastname": "Doe",
        "firstname": "John",
        "address": "1 rue de la Paix",
        "postal": "75000",
        "city": "Paris",
        "country": "France",
        "phone": "0033612345678",
        "email": "[email protected]",
        "is_company": true,
        "credit": 0
      }
    ]
  ]
}
Response fields 3
  • code integer

    Example: 200

  • info string

    Example: Customer list fetched

  • data object[][]

    Associative array $key=>$value where $key is the ID and $value is the contact informations

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.

404

No contacts found. Either an error occured or there are no contacts managed by the user

{
  "code": 404,
  "info": "No contacts could be fetched",
  "data": []
}
Response fields 3
  • code integer

    Example: 404

  • info string

    Example: No contacts could be fetched

  • data any[]
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": "Details on the error"
}
Response fields 3
  • code integer

    Example: 500

  • info string

    Example: Internal Server Error

  • data string

    Example: Details on the error

502

Invalid response returned. Generally means returned data was not expected.

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

    Example: 502

  • info string

    Example: Invalid response from upstream server

  • data any[]

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

Show the code examples and the test console
GET /contact/0/list
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X GET \  "https://api.lws.net/v1/contact/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/contact/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/contact/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/contact/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/contact/0/list", nil)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)resp, err := http.DefaultClient.Do(req)