Продукты Р7
Корпоративный сервер 2024
Корпоративный сервер 2024
Сервер документов
Сервер документов
Редакторы
Редакторы
Корпоративный сервер 2019
Корпоративный сервер 2019
Графика
Графика
Команда
Команда
Мобильные редакторы
Мобильные редакторы
Облачный офис
Облачный офис
Почта
Почта
Органайзер
Органайзер
Дополнительно
Часто задаваемые вопросы
Разработчикам
Интеграции
Новые возможности

Создать пользовательское поле

Обновлено: 15.12.25

POST api/2.0/crm/{entityType}/customfield

Для этой функции требуется аутентификация. 

Описание
Создает новое пользовательское поле с параметрами (тип сущности, заголовок поля, тип и т.д.), указанными в запросе.

Параметры

Название Описание Тип Пример
entityType

sent in url
Тип сущности

Допустимые значения: contact, person, company, opportunity, case
строковый текст
label

sent in body
Название поля строковый текст
fieldType

sent in body
Тип пользовательского поля

Допустимые значения: TextField, TextArea, SelectBox, CheckBox, Heading or Date
номер 1234
position

sent in body
Позиция поля

необязательно
номер 1234
mask

sent in body
Mask (Шаблон?)

Отправить только в формате JSON

необязательно
строковый текст
Пример
             
             Data transfer in application/json format:
             
             1) Creation of the TextField custom field:
             
             data: {
                entityType: "contact",
                label: "Sample TextField",
                fieldType: 0,
                position: 0,
                mask: {"size":"40"}  // This is the TextField size. All other values are ignored.
             }
             
             
             2) Creation of the TextArea custom field:
             
             data: {
                entityType: "contact",
                label: "Sample TextArea",
                fieldType: 1,
                position: 1,
                mask: '{"rows":"2","cols":"30"}' // This is the TextArea size. All other values are ignored.
             }
             
             
             3) Creation of the SelectBox custom field:
             
             data: {
                entityType: "contact",
                label: "Sample SelectBox",
                fieldType: 2,
                position: 0,
                mask: ["1","2","3"]  // These are the SelectBox values.
             }
             
             
             
             4) Creation of the CheckBox custom field:
             
             data: {
                entityType: "contact",
                label: "Sample CheckBox",
                fieldType: 3,
                position: 0,
                mask: ""     
             }
             
             
             
             5) Creation of the Heading custom field:
             
             data: {
                entityType: "contact",
                label: "Sample Heading",
                fieldType: 4,
                position: 0,
                mask: "" 
             }
             
             
             
             6) Creation of the Date custom field:
             
             data: {
                entityType: "contact",
                label: "Sample Date",
                fieldType: 5,
                position: 0,
                mask: "" 
             }
             
             

Возвращает
Пользовательское поле

Пример Ответа

application/json

{
  "status": 0,
  "response": {
    "relativeItemsCount": 0,
    "entityId": 14523423,
    "label": "Birthdate",
    "fieldValue": "2022-10-08T15:03:33.1475255Z",
    "fieldType": 5,
    "position": 10,
    "mask": "",
    "id": 0
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <relativeItemsCount>0</relativeItemsCount>
    <entityId>14523423</entityId>
    <label>Birthdate</label>
    <fieldValue>2022-10-08T15:03:33.1475255Z</fieldValue>
    <fieldType>5</fieldType>
    <position>10</position>
    <mask></mask>
    <id>0</id>
  </response>
</result>