Planfix API contact.add
From Planfix
Function to add a contact. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="contact.add">
<account></account>
<sid></sid>
<contact>
<template></template>
<name></name>
<midName></midName>
<lastName></lastName>
<post></post>
<email></email>
<phones>
<phone>
<number></number>
<typeId></typeId>
<typeName></typeName>
</phone>
<!-- ... -->
</phones>
<secondaryEmails>
<email></email>
<!-- ... -->
</secondaryEmails>
<address></address>
<description></description>
<sex></sex>
<site></site>
<skype></skype>
<facebook></facebook>
<vk></vk>
<icq></icq>
<birthdate></birthdate>
<lang></lang>
<isCompany></isCompany>
<canBeWorker></canBeWorker>
<canBeClient></canBeClient>
<group>
<id></id>
</group>
<customData>
<customValue>
<id></id>
<value></value>
</customValue>
<!-- ... -->
</customData>
<responsible>
<users>
<id></id>
<id></id>
<!-- ... -->
</users>
<groups>
<id></id>
<id></id>
<!-- ... -->
</groups>
</responsible>
</contact>
<signature></signature>
</request>
Name | Type | Value | Note |
---|---|---|---|
template | int | contact template number, (general in contact.getList results) | |
The API's implementation for creating a contact using a template is currently unfinished.
The contact creation form, corresponding custom fields, and some of its properties are configured based on the template. However, data tags, files, checklists, and reminders are not currently configured from the template. | |||
name | string | Name | |
midName | string | Middle name | |
lastName | string | Last name | |
post | string | Position | |
string | email address | ||
phones | string | phones | |
phone.number | string | phone number | |
phone.typeId | int | phone number type identifier | acceptable values can be obtained by the function contact.getPhoneTypes |
phone.typeName | string | phone number type name | |
secondaryEmails | string | additional email addresses | |
secondaryEmails.email | string | ||
address | string | Address | |
description | string | Additional information | |
sex | enum | gender | acceptable values see in the customer's gender section |
site | string | website | |
skype | string | skype | |
string | |||
icq | string | номер-icq | |
birthdate | DateTime | birthdate | |
lang | string | language:En | |
isCompany | boolean | is a company | |
canBeWorker | boolean | displayed in the task participant list | |
canBeClient | boolean | displayed in the task counterparty list | |
group.id | int | contact group identifier | acceptable values can be obtained by the function contact.getGroupList |
customData | contact custom field values | ||
customData.customValue.id | contact custom field identifier | can be obtained by calling contact.get of the template by which the contact is created | |
customData.customValue.value | contact custom field value | (for task set type fields, employee list, directory record set - identifiers separated by commas in square brackets) | |
responsible | root element of the supervisor list | ||
responsible .users | root element of the supervisor user list | ||
responsible .users.id | int | user identifier | |
responsible .groups | root element of the supervisor group list | ||
responsible .groups.id | int | group identifier | |
signature | string(32) | signature |
Result of successful function execution:
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<contact>
<id></id>
<userid></userid>
<general></general>
</contact>
<actionid></actionid>
</response>
Name | Type | Value | Note |
---|---|---|---|
contact.id | int | identifier of the added contact | |
contact.userid | int | contact identifier for cases when it is used in the system on par with employees (task assignee, etc.) | |
contact.general | int | number of the added contact | |
actionid | int | identifier of the contact creation action |
Otherwise, an error response will be returned:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
<code></code>
</response>