Get Contact Fields crm.contact.fields
Scope:
crmWho can execute the method: any user
Method Development Stopped
The method crm.contact.fields continues to function, but there is a more relevant alternative crm.item.fields.
The method returns a description of contact fields, including custom fields.
No parameters required.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.contact.fields
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.contact.fields
try
{
const response = await $b24.callMethod(
'crm.contact.fields',
{}
);
const result = response.getData().result;
console.info('Contact fields', result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'crm.contact.fields',
[]
);
$result = $response
->getResponseData()
->getResult();
if ($result->error()) {
error_log($result->error());
echo 'Error: ' . $result->error();
} else {
echo 'Contact fields: ' . print_r($result->data(), true);
}
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error fetching contact fields: ' . $e->getMessage();
}
BX24.callMethod(
"crm.contact.fields",
{},
(result) => {
if(result.error())
console.error(result.error());
else
console.info("Contact fields", result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.contact.fields',
[]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP status: 200
{
"result": {
"ID": {
"type": "integer",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "ID"
},
"HONORIFIC": {
"type": "crm_status",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"statusType": "HONORIFIC",
"title": "Salutation"
},
"NAME": {
"type": "string",
"isRequired": true,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "First Name"
},
"SECOND_NAME": {
"type": "string",
"isRequired": true,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Middle Name"
},
"LAST_NAME": {
"type": "string",
"isRequired": true,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Last Name"
},
"PHOTO": {
"type": "file",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Photo"
},
"BIRTHDATE": {
"type": "date",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Birthdate"
},
"TYPE_ID": {
"type": "crm_status",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"statusType": "CONTACT_TYPE",
"title": "Contact Type"
},
"SOURCE_ID": {
"type": "crm_status",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"statusType": "SOURCE",
"title": "Source"
},
"SOURCE_DESCRIPTION": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Additional Source Info"
},
"POST": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Position"
},
"ADDRESS": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Address"
},
"ADDRESS_2": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Address (line 2)"
},
"ADDRESS_CITY": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "City"
},
"ADDRESS_POSTAL_CODE": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Postal Code"
},
"ADDRESS_REGION": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Region"
},
"ADDRESS_PROVINCE": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "State"
},
"ADDRESS_COUNTRY": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Country"
},
"ADDRESS_COUNTRY_CODE": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Country Code"
},
"ADDRESS_LOC_ADDR_ID": {
"type": "integer",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Location Address ID"
},
"COMMENTS": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Comment"
},
"OPENED": {
"type": "char",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Available to all"
},
"EXPORT": {
"type": "char",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Participates in contact export"
},
"HAS_PHONE": {
"type": "char",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Phone set"
},
"HAS_EMAIL": {
"type": "char",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "E-mail set"
},
"HAS_IMOL": {
"type": "char",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Open channel set"
},
"ASSIGNED_BY_ID": {
"type": "user",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Responsible"
},
"CREATED_BY_ID": {
"type": "user",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Created by"
},
"MODIFY_BY_ID": {
"type": "user",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Modified by"
},
"DATE_CREATE": {
"type": "datetime",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Creation Date"
},
"DATE_MODIFY": {
"type": "datetime",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Modification Date"
},
"COMPANY_ID": {
"type": "crm_company",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"isDeprecated": true,
"title": "Company"
},
"COMPANY_IDS": {
"type": "crm_company",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "COMPANY_IDS"
},
"LEAD_ID": {
"type": "crm_lead",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Lead",
"settings": {
"parentEntityTypeId": 1
}
},
"ORIGINATOR_ID": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "External Source"
},
"ORIGIN_ID": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Identifier in External Source"
},
"ORIGIN_VERSION": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Original Version"
},
"UTM_SOURCE": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Advertising System"
},
"UTM_MEDIUM": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Traffic Type"
},
"UTM_CAMPAIGN": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Campaign Identifier"
},
"UTM_CONTENT": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Campaign Content"
},
"UTM_TERM": {
"type": "string",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Campaign Search Condition"
},
"LAST_ACTIVITY_TIME": {
"type": "datetime",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Last Activity"
},
"LAST_ACTIVITY_BY": {
"type": "user",
"isRequired": false,
"isReadOnly": true,
"isImmutable": false,
"isMultiple": false,
"isDynamic": false,
"title": "Last Activity Author"
},
"PHONE": {
"type": "crm_multifield",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "Phone"
},
"EMAIL": {
"type": "crm_multifield",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "E-mail"
},
"WEB": {
"type": "crm_multifield",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "Website"
},
"IM": {
"type": "crm_multifield",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "Messenger"
},
"LINK": {
"type": "crm_multifield",
"isRequired": false,
"isReadOnly": false,
"isImmutable": false,
"isMultiple": true,
"isDynamic": false,
"title": "LINK"
}
},
"time": {
"start": 1715004755.782705,
"finish": 1715004756.118899,
"duration": 0.3361940383911133,
"processing": 0.10344505310058594,
"date_start": "2024-05-06T17:12:35+03:00",
"date_finish": "2024-05-06T17:12:36+03:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
ID |
Contact identifier. Read-only |
|
HONORIFIC |
Salutation. You can get the values of the directory using the method crm.status.list with a filter by |
|
NAME |
First Name |
|
SECOND_NAME |
Middle Name |
|
LAST_NAME |
Last Name |
|
PHOTO |
Photo |
|
BIRTHDATE |
Birthdate |
|
TYPE_ID |
Contact Type. You can get the values of the directory using the method crm.status.list with a filter by |
|
SOURCE_ID |
Source. You can get the values of the directory using the method crm.status.list with a filter by |
|
SOURCE_DESCRIPTION |
Additional Source Info |
|
POST |
Position |
|
COMMENTS |
Comment. Supports BB codes |
|
OPENED |
Available to all. Possible values:
Considered in the access permission work for roles with "All Open" access level |
|
EXPORT |
Participates in contact export. Possible values:
|
|
HAS_PHONE |
Is phone set. Possible values:
Read-only |
|
HAS_EMAIL |
Is e-mail set. Possible values:
Read-only |
|
HAS_IMOL |
Is open channel set. Possible values:
Read-only |
|
ASSIGNED_BY_ID |
Responsible |
|
CREATED_BY_ID |
Created by. Read-only |
|
MODIFY_BY_ID |
Modified by. Read-only |
|
DATE_CREATE |
Creation Date. Read-only |
|
DATE_MODIFY |
Modification Date. Read-only |
|
COMPANY_ID |
Main company of the contact |
|
COMPANY_IDS |
Contact association with companies. Multiple. In the methods In the methods |
|
LEAD_ID |
Identifier of the lead associated with the contact. Read-only |
|
UTM_SOURCE |
Advertising system (Google Ads, etc.) |
|
UTM_MEDIUM |
Traffic type. Possible values:
|
|
UTM_CAMPAIGN |
Campaign identifier |
|
UTM_CONTENT |
Campaign content. For example, for contextual ads |
|
UTM_TERM |
Campaign search condition. For example, keywords for contextual advertising |
|
LAST_ACTIVITY_TIME |
Last activity date in the timeline. Read-only |
|
LAST_ACTIVITY_BY |
Author of the last activity in the timeline. Read-only |
|
PHONE |
Phones. Multiple |
|
EMAIL |
E-mail. Multiple |
|
WEB |
Websites. Multiple |
|
Messengers. Multiple |
|
|
LINK |
Links. Multiple. Service field. |
|
UF_... |
Custom fields. For example, Depending on the account settings, contacts may have a set of custom fields of defined types. You can add a custom field to a contact using the method crm.contact.userfield.add |
|
PARENT_ID_... |
Relationship fields. If there are smart processes related to contacts in the account, for each such smart process there is a field that stores the relationship between this smart process and the contact. The field itself stores the identifier of the element of that smart process. For example, the field |
Fields for External Data Sources
If the contact was created by an external system, then:
- the field
ORIGINATOR_IDstores the string identifier of that system - the field
ORIGIN_IDstores the string identifier of the contact in that external system - the field
ORIGIN_VERSIONstores the version of the contact data in that external system
|
Name |
Description |
|
ORIGINATOR_ID |
Identifier of the external system that is the source of data about this contact |
|
ORIGIN_ID |
Identifier of the contact in the external system |
|
ORIGIN_VERSION |
Version of the contact data in the external system. Used to protect data from accidental overwriting by the external system. If the data was imported and not changed in the external system, then such data can be edited in CRM without fear that the next export will lead to data overwriting |
Deprecated Fields
Address fields in the contact are deprecated and are only used for compatibility mode. To work with the address, use requisites.
|
Name |
Description |
|
ADDRESS |
Address |
|
ADDRESS_2 |
Second line of address |
|
ADDRESS_CITY |
City |
|
ADDRESS_POSTAL_CODE |
Postal Code |
|
ADDRESS_REGION |
Region |
|
ADDRESS_PROVINCE |
State |
|
ADDRESS_COUNTRY |
Country |
|
ADDRESS_COUNTRY_CODE |
Country Code |
|
ADDRESS_LOC_ADDR_ID |
Location Address ID |
Error Handling
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |
Continue Learning
- Create a new contact crm.contact.add
- Update Contact crm.contact.update
- Get Contact by Id crm.contact.get
- Get the list of contacts crm.contact.list
- Delete contact crm.contact.delete