API documentation Web hosting accessible to everyone Visit LWS

Create a new contact

POST https://api.lws.net/v1/contact

operationIdpostContact

Create a new contact, managed by your account, that can then be used to connect to our services. Leaving the company field blank will create an individual contact.

Request body

  • company any

    Company name (optional)

    Example: My Company

    optional
  • lastname any

    Last name

    Example: Doe

    optional
  • firstname any

    First name

    Example: John

    optional
  • address any

    Street address

    Example: 1 rue de la Paix

    optional
  • postal string

    Postal code

    Example: 75000

    optional
  • city any

    City

    Example: Paris

    optional
  • country any

    Country

    Example: FR

    optional
  • phone any

    Phone number for the contact in the international format 00{country code}{number}

    pattern ^00\d{1,3}\d{6,12}$ Example: 0033612345678

    optional
  • email any

    Email address

    Example: [email protected]

    optional
  • password any

    Password

    Example: password

    optional
Example request
{
  "company": "My Company",
  "lastname": "Doe",
  "firstname": "John",
  "address": "1 rue de la Paix",
  "postal": "75000",
  "city": "Paris",
  "country": "FR",
  "phone": "0033612345678",
  "email": "[email protected]",
  "password": "password"
}

Responses

200

Contact successfully created

{
  "code": 200,
  "info": "Contact successfully created",
  "data": "367228"
}
Response fields 3
  • code integer

    Example: 200

  • info string

    Example: Contact successfully created

  • data string

    ID of the newly created contact. Can be used to GET contacts's informations

    Example: 367228

400

Invalid parameters or duplicate contact

{
  "code": 400,
  "info": {
    "email": "Invalid email address format. Example: [email protected]",
    "phone": "Required field"
  },
  "data": {
    "email": "Email regex pattern",
    "phone": "Phone number regex pattern"
  }
}
Response fields 3
  • code integer

    Example: 400

  • info object

    Example: {"email":"Invalid email address format. Example: [email protected]","phone":"Required field"}

  • data object

    Example: {"email":"Email regex pattern","phone":"Phone number regex pattern"}

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