API documentation Web hosting accessible to everyone Visit LWS

Fetch a contact

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

operationIdgetContact

Retrieve informations about a contact using their ID. Said ID can be found using the '/contact/0/list' action and is also given at the contact creation. Only contacts managed by the user can be fetched.

Path parameters

contact integer required

ID of the contact to look for

Example: 367228

Responses

200

Contact successfully fetched

{
  "code": 200,
  "info": "Contact 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 14
  • code integer

    Example: 200

  • info string

    Example: Contact fetched

  • data object

    Contact information response schema

    ContactGet

  • company any

    Company name (optional)

    Example: My Company

  • lastname any

    Last name

    Example: Doe

  • firstname any

    First name

    Example: John

  • address any

    Street address

    Example: 1 rue de la Paix

  • postal string

    Postal code

    Example: 75000

  • city any

    City

    Example: Paris

  • country any

    Country

    Example: France

  • 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

  • email any

    Email address

    Example: [email protected]

  • is_company any

    Whether the contact is for a company or not

    Example: true

  • credit any

    Credit balance

    Example: 0

400

Failed to retrieve the contact. Generally means a contact with such ID does not exist or is not valid.

{
  "code": 400,
  "info": "No contact provided"
}
Response fields 2
  • code integer

    Example: 400

  • info string

    Example: No contact provided

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. Details about the error will be provided in 'data'

{
  "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/{contact}
LWS_AUTH_LOGIN='…'LWS_AUTH_PASS='…'curl -X GET \  "https://api.lws.net/v1/contact/367228" \  -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/367228");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/367228",    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/367228", {  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/367228", nil)req.Header.Set("X-Auth-Login", lwsAuthLogin)req.Header.Set("X-Auth-Pass", lwsAuthPass)resp, err := http.DefaultClient.Do(req)