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

Obtenir tous les contacts gérés par l'utilisateur

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

operationIdget0List

Récupère un tableau associatif [ID => {données}] de tous les contacts gérés par l'utilisateur.

Réponses

200

Liste des contacts récupérée avec succès

{
  "code": 200,
  "info": "Customer list fetched",
  "data": [
    [
      {
        "company": "Ma Société",
        "lastname": "Dupont",
        "firstname": "Jean",
        "address": "1 rue de la Paix",
        "postal": "75000",
        "city": "Paris",
        "country": "France",
        "phone": "0033612345678",
        "email": "[email protected]",
        "is_company": true,
        "credit": 0
      }
    ]
  ]
}
Champs de la réponse 3
  • code integer

    Exemple: 200

  • info string

    Exemple: Customer list fetched

  • data object[][]

    Tableau associatif $key=>$value où $key est l'ID et $value les informations du contact

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.

404

Aucun contact trouvé. Soit une erreur s'est produite, soit aucun contact n'est géré par l'utilisateur

{
  "code": 404,
  "info": "No contacts could be fetched",
  "data": []
}
Champs de la réponse 3
  • code integer

    Exemple: 404

  • info string

    Exemple: No contacts could be fetched

  • data any[]
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": "Details on the error"
}
Champs de la réponse 3
  • code integer

    Exemple: 500

  • info string

    Exemple: Internal Server Error

  • data string

    Exemple: Details on the error

502

Réponse invalide retournée. Signifie généralement que les données retournées n'étaient pas attendues.

{
  "code": 502,
  "info": "Invalid response from upstream server",
  "data": {
    "status": 500,
    "error": "Internal Server Error"
  }
}
Champs de la réponse 3
  • code integer

    Exemple: 502

  • info string

    Exemple: Invalid response from upstream server

  • data any[]

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

Afficher les exemples de code et la console de test
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)