Create a new contact
POST
https://api.lws.net/v1/
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
application/json
-
companyanyoptionalCompany name (optional)
-
lastnameanyoptionalLast name
-
firstnameanyoptionalFirst name
-
addressanyoptionalStreet address
-
postalstringoptionalPostal code
-
cityanyoptionalCity
-
countryanyoptionalCountry
-
phoneanyoptionalPhone number for the contact in the international format 00{country code}{number}
-
emailanyoptionalEmail address
-
passwordanyoptionalPassword
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
-
codeinteger -
infostring -
datastringID of the newly created contact. Can be used to GET contacts's informations
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
-
codeinteger -
infoobject -
dataobject
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
-
codeinteger -
infostring
429
Rate limit exceeded
{
"code": 429,
"info": "Rate limit exceeded. Please try again later."
}
Response fields 2
-
codeinteger -
infostring
500
Internal Server Error
{
"code": 500,
"info": "Internal Server Error",
"data": "Details on the error"
}
Response fields 3
-
codeinteger -
infostring -
datastring
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
-
codeinteger -
infostring -
dataany[]