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

Mettre à jour les informations d'un contact existant

PUT https://api.lws.net/v1/contact/{contact}

operationIdputContact

Met à jour les informations d'un contact existant. Seuls les champs fournis seront mis à jour.

Paramètres du chemin

contact integer requis

ID du contact à mettre à jour

Corps de la requête

  • address any

    Adresse postale

    Exemple: 1 rue de la Paix

    facultatif
  • postal string

    Code postal

    Exemple: 75000

    facultatif
  • city any

    Ville

    Exemple: Paris

    facultatif
  • country any

    Pays

    Exemple: FR

    facultatif
  • phone any

    Numéro de téléphone du contact au format international 00{code pays}{numéro}

    motif ^00\d{1,3}\d{6,12}$ Exemple: 0033612345678

    facultatif
  • password any

    Mot de passe

    Exemple: password

    facultatif
Exemple de requête
{
  "address": "1 rue de la Paix",
  "postal": "75000",
  "city": "Paris",
  "country": "FR",
  "phone": "0033612345678",
  "password": "password"
}

Réponses

200

Contact mis à jour avec succès

{
  "code": 200,
  "info": "Updated contact information",
  "data": {
    "address": "1 rue de la Paix",
    "postal": "75000",
    "city": "Paris",
    "country": "FR",
    "phone": "0033612345678",
    "password": "password"
  }
}
Champs de la réponse 9
  • code integer

    Exemple: 200

  • info string

    Exemple: Updated contact information

  • data object
  • address any

    Adresse postale

    Exemple: 1 rue de la Paix

  • postal string

    Code postal

    Exemple: 75000

  • city any

    Ville

    Exemple: Paris

  • country any

    Pays

    Exemple: FR

  • phone any

    Numéro de téléphone du contact au format international 00{code pays}{numéro}

    motif ^00\d{1,3}\d{6,12}$ Exemple: 0033612345678

  • password any

    Mot de passe

    Exemple: password

201

Rien à mettre à jour car aucun champ n'a été fourni

{
  "code": 201,
  "info": "Nothing to update"
}
Champs de la réponse 2
  • code integer

    Exemple: 201

  • info string

    Exemple: Nothing to update

400

Des paramètres invalides ont été fournis

{
  "code": 400,
  "info": "Invalid input",
  "data": {
    "city": "Invalid field, refer to the associated regex for more details"
  }
}
Champs de la réponse 3
  • code integer

    Exemple: 400

  • info string

    Exemple: Invalid input

  • data object

    Exemple: {"city":"Invalid field, refer to the associated regex for more details"}

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": "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
PUT /contact/{contact}
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X PUT \  "https://api.lws.net/v1/contact/{contact}" \  -H "X-Auth-Login: $LWS_AUTH_LOGIN" \  -H "X-Auth-Pass: $LWS_AUTH_PASS" \  -H "Content-Type: application/json" \  -d '{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}'
$lwsAuthLogin = '…';$lwsAuthPass = '…';$ch = curl_init("https://api.lws.net/v1/contact/{contact}");curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");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, '{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}');$res = json_decode(curl_exec($ch), true);
import requestsLWS_AUTH_LOGIN = "…"LWS_AUTH_PASS = "…"res = requests.put(    "https://api.lws.net/v1/contact/{contact}",    headers={        "X-Auth-Login": LWS_AUTH_LOGIN,        "X-Auth-Pass": LWS_AUTH_PASS,    },    json={"address": "1 rue de la Paix", "postal": "75000", "city": "Paris", "country": "FR", "phone": "0033612345678", "password": "password"},)print(res.json())
const LWS_AUTH_LOGIN = "…";const LWS_AUTH_PASS = "…";const res = await fetch("https://api.lws.net/v1/contact/{contact}", {  method: "PUT",  headers: {    "X-Auth-Login": LWS_AUTH_LOGIN,    "X-Auth-Pass": LWS_AUTH_PASS,    "Content-Type": "application/json",  },  body: JSON.stringify({"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}),});const data = await res.json();
lwsAuthLogin := "…"lwsAuthPass := "…"body := strings.NewReader(`{"address":"1 rue de la Paix","postal":"75000","city":"Paris","country":"FR","phone":"0033612345678","password":"password"}`)req, _ := http.NewRequest("PUT",    "https://api.lws.net/v1/contact/{contact}", 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)