Add
Adding a contact person
POST https://do.workzeal.com/contact/insert
Creates a contact person for an existing client, together with their phones and email addresses. The full name is assembled automatically from the last name, first name, and middle name.
Request Body
| Name | Type | Description |
|---|---|---|
| company_id* | Int | Client ID |
| first_name | String | First name |
| last_name | String | Last name |
| middle_name | String | Middle name |
| position | String | Position: a value of the "Positions" directory. It is matched case-insensitively, and a new one is added to the directory automatically |
| note | String | Note |
| status_id | Int | Contact person status code |
| Emails | JSON | List of email addresses [{ "email" }] |
| Phones | JSON | List of phones [{ "phone", "descr" }] |
{
"company_id" : 368132,
"first_name" : "John",
"last_name" : "Smith",
"middle_name" : "Michael",
"position" : "CEO",
"note" : "Makes purchasing decisions",
"status_id" : 1,
"Emails": [
{
"email": "john.smith@example.com"
}
],
"Phones": [
{
"phone": "+1 212 555-0134",
"descr": "Mobile"
}
]
}
Note
The only required parameter is company_id. The client ID is returned when adding a company or can be found through the list of clients.
A phone or email is added to an existing contact person with the methods on the Phones and emails page by passing contact_id.
Example
cURL
NodeJS (Request)
curl --location --request POST 'https://do.workzeal.com/contact/insert' \
--header 'Authorization: Bearer XXXX-XXXXXXX-XXXXXXX' \
--header 'Content-Type: application/json' \
--data-raw '{
"company_id" : 368132,
"first_name" : "John",
"last_name" : "Smith",
"position" : "CEO"
}
'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://do.workzeal.com/contact/insert',
'headers': {
'Authorization': 'Bearer XXXX-XXXXXXX-XXXXXXX',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"company_id": 368132,
"first_name": "John",
"last_name": "Smith",
"position": "CEO"
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Response
{
"status": "success",
"error": "",
"code": null,
"rows": 0,
"pages": 0,
"page": 0,
"value": "{\"NEW_ID\":186442,\"TELEPHONES\":null,\"EMAILS\":null}"
}
// NEW_ID - ID of the new contact person