Add Storage Element entity.item.add
We are still updating this page
Some data may be missing — we will fill it in shortly.
Scope:
entityWho can execute the method: any user
The method entity.item.add adds a storage element. The user must have at least write access permission (W) in the storage.
Parameters
|
Parameter |
Description |
|
ENTITY* |
Required. String identifier of the storage. |
|
NAME* |
Required. Name of the element. |
|
ACTIVE |
Element active flag (Y|N). |
|
DATE_ACTIVE_FROM |
Start date of the element's activity. |
|
DATE_ACTIVE_TO |
End date of the element's activity. |
|
SORT |
Sorting weight of the element. |
|
PREVIEW_PICTURE |
Preview image of the element. How to upload a file in the field is described in the article How to upload files. |
|
PREVIEW_TEXT |
Preview text of the element. |
|
DETAIL_PICTURE |
Detailed image of the element. How to upload a file in the field is described in the article How to upload files. |
|
DETAIL_TEXT |
Detailed text of the element. |
|
CODE |
Symbolic code of the element. |
|
SECTION |
Identifier of the storage section. |
|
PROPERTY_VALUES |
Associative list of property values of the element. Storage properties are created using entity.item.property.add. |
Required parameters are marked with *
Example
try
{
const response = await $b24.callMethod(
'entity.item.add',
{
ENTITY: 'menu_new',
DATE_ACTIVE_FROM: new Date(),
DETAIL_PICTURE: '',
NAME: 'Hello, world!',
PROPERTY_VALUES: {
test: 11,
test1: 22,
test_file: ''
},
SECTION: 219
}
);
const result = response.getData().result;
// Your required data processing logic
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'entity.item.add',
[
'ENTITY' => 'menu_new',
'DATE_ACTIVE_FROM' => new DateTime(),
'DETAIL_PICTURE' => '',
'NAME' => 'Hello, world!',
'PROPERTY_VALUES' => [
'test' => 11,
'test1' => 22,
'test_file' => ''
],
'SECTION' => 219
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your required data processing logic
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error adding entity item: ' . $e->getMessage();
}
BX24.callMethod(
'entity.item.add',
{
ENTITY: 'menu_new',
DATE_ACTIVE_FROM: new Date(),
DETAIL_PICTURE: '',
NAME: 'Hello, world!',
PROPERTY_VALUES: {
test: 11,
test1: 22,
test_file: ''
},
SECTION: 219
}
);
https://my.bitrix24.com/rest/entity.item.add.json?DATE_ACTIVE_FROM=2013-06-26T11%3A54%3A30.421Z&DETAIL_PICTURE=&ENTITY=menu_new&NAME=Hello%2C%20world!&PROPERTY_VALUES%5Btest1%5D=22&PROPERTY_VALUES%5Btest%5D=11&PROPERTY_VALUES%5Btest_file%5D=&SECTION=219&auth=9affe382af74d9c5caa588e28096e872
How to Use Examples in Documentation
Response on Success
200 OK
{"result":842}