Set Parameters for crm.lead.details.configuration.set
Scope:
crmWho can execute the method:
- any user can set their own settings,
- a user with the "Allow to change settings" permission in CRM can set others' and shared settings.
Method Development Halted
The method crm.lead.details.configuration.set continues to function, but there is a more relevant alternative: crm.item.details.configuration.set.
The method crm.lead.details.configuration.set sets the settings for lead cards.
Warning
The settings for repeat leads may differ from those for simple leads. To switch between lead card settings, use the leadCustomerType parameter.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
data* |
A list of sections in the card. Each section contains a set of fields that will be displayed in the lead card. |
|
userId |
The identifier of the user for whom to save the personal configuration. If the parameter is not provided, the Required only when setting personal settings. |
|
scope |
The scope of the settings. Possible values:
The default value is |
|
extras |
Additional parameters for selecting the lead type. The structure is described below |
Parameter section
|
Name |
Description |
|
name* |
Unique name of the section. |
|
title* |
Title of the section. |
|
type* |
Type of the section. Only the value |
|
elements |
A list of fields displayed in the section. |
Parameter section_element
|
Name |
Description |
|
name* |
Identifier of the lead field. A list of available fields can be obtained using the crm.lead.fields method. |
|
optionFlags |
Whether to always show the field:
The default value is |
|
options |
Additional options for the field. The set of options depends on the field type. |
Parameter extras
|
Name |
Description |
|
leadCustomerType |
Type of lead. Possible values:
|
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"scope":"P","userId":1,"extras":{"leadCustomerType":2},"data":[{"name":"main","title":"About the Lead","type":"section","elements":[{"name":"TITLE"},{"name":"STATUS_ID"},{"name":"SOURCE_ID"},{"name":"NAME"},{"name":"PHONE","optionFlags":1}]},{"name":"additional","title":"Additional Information","type":"section","elements":[{"name":"ASSIGNED_BY_ID"},{"name":"COMMENTS"}]}]}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.lead.details.configuration.set
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"scope":"P","userId":1,"extras":{"leadCustomerType":2},"data":[{"name":"main","title":"About the Lead","type":"section","elements":[{"name":"TITLE"},{"name":"STATUS_ID"},{"name":"SOURCE_ID"},{"name":"NAME"},{"name":"PHONE","optionFlags":1}]},{"name":"additional","title":"Additional Information","type":"section","elements":[{"name":"ASSIGNED_BY_ID"},{"name":"COMMENTS"}]}],"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.lead.details.configuration.set
try
{
const response = await $b24.callMethod(
'crm.lead.details.configuration.set',
{
scope: 'P',
userId: 1,
extras: {
leadCustomerType: 2,
},
data: [
{
name: 'main',
title: 'About the Lead',
type: 'section',
elements: [
{ name: 'TITLE' },
{ name: 'STATUS_ID' },
{ name: 'SOURCE_ID' },
{ name: 'NAME' },
{ name: 'PHONE', optionFlags: 1 },
],
},
{
name: 'additional',
title: 'Additional Information',
type: 'section',
elements: [
{ name: 'ASSIGNED_BY_ID' },
{ name: 'COMMENTS' },
],
},
],
}
);
const result = response.getData().result;
console.info(result);
}
catch (error)
{
console.error(error);
}
try {
$response = $b24Service
->core
->call(
'crm.lead.details.configuration.set',
[
'scope' => 'P',
'userId' => 1,
'extras' => [
'leadCustomerType' => 2,
],
'data' => [
[
'name' => 'main',
'title' => 'About the Lead',
'type' => 'section',
'elements' => [
['name' => 'TITLE'],
['name' => 'STATUS_ID'],
['name' => 'SOURCE_ID'],
['name' => 'NAME'],
['name' => 'PHONE', 'optionFlags' => 1],
],
],
[
'name' => 'additional',
'title' => 'Additional Information',
'type' => 'section',
'elements' => [
['name' => 'ASSIGNED_BY_ID'],
['name' => 'COMMENTS'],
],
],
],
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Result: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
'crm.lead.details.configuration.set',
{
scope: 'P',
userId: 1,
extras: {
leadCustomerType: 2
},
data: [
{
name: 'main',
title: 'About the Lead',
type: 'section',
elements: [
{ name: 'TITLE' },
{ name: 'STATUS_ID' },
{ name: 'SOURCE_ID' },
{ name: 'NAME' },
{ name: 'PHONE', optionFlags: 1 }
]
},
{
name: 'additional',
title: 'Additional Information',
type: 'section',
elements: [
{ name: 'ASSIGNED_BY_ID' },
{ name: 'COMMENTS' }
]
}
]
},
function(result)
{
if (result.error())
{
console.error(result.error());
}
else
{
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'crm.lead.details.configuration.set',
[
'scope' => 'P',
'userId' => 1,
'extras' => [
'leadCustomerType' => 2,
],
'data' => [
[
'name' => 'main',
'title' => 'About the Lead',
'type' => 'section',
'elements' => [
['name' => 'TITLE'],
['name' => 'STATUS_ID'],
['name' => 'SOURCE_ID'],
['name' => 'NAME'],
['name' => 'PHONE', 'optionFlags' => 1],
],
],
[
'name' => 'additional',
'title' => 'Additional Information',
'type' => 'section',
'elements' => [
['name' => 'ASSIGNED_BY_ID'],
['name' => 'COMMENTS'],
],
],
],
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": true,
"time": {
"start": 1720728468.828951,
"finish": 1720728469.214046,
"duration": 0.38509488105773926,
"processing": 0.018099069595336914,
"date_start": "2024-07-11T22:54:28+02:00",
"date_finish": "2024-07-11T22:54:29+02:00",
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
The root element of the response. Returns |
|
time |
Information about the execution time of the request. |
Error Handling
HTTP Status: 400
{
"error": "",
"error_description": "Element at index 0 in section at index 1 does not have name."
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Code |
Description |
Value |
|
|
Access denied |
Insufficient permissions. |
|
|
Parameter |
|
|
|
The data must be indexed array |
|
|
|
There are no data to write |
|
|
|
Section at index |
|
|
|
Section at index |
|
|
|
Section at index |
|
|
|
Element at index |
|
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
- Managing Lead Cards: Overview of Methods
- Get Parameters of crm.lead.details.configuration.get
- Reset CRM Lead Details Configuration Parameters
- Set a Common Lead Card for All Users crm.lead.details.configuration.forceCommonScopeForAll