Get the list of sections entity.section.get
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.section.get retrieves a list of sections from the storage (information block sections). It is a list method.
The user must have at least read access permission (R) to the storage.
Parameters
|
Parameter |
Description |
|
ENTITY* |
Required. String identifier of the storage. |
|
SORT |
An array for sorting, in the form
order1, ... - sorting order, which can take the following values:
|
|
FILTER |
An array in the form
|
|
start |
The ordinal number of the list item from which to return the next items when calling the current method. Details in the article Features of List Methods |
Required parameters are marked with *
Examples
try
{
const response = await $b24.callMethod(
'entity.section.get',
{
ENTITY: 'menu_new',
SORT: {
'NAME': 'ASC'
}
}
);
const sections = response.getData().result;
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'entity.section.get',
[
'ENTITY' => 'menu_new',
'SORT' => [
'NAME' => 'ASC'
]
]
);
$result = $response
->getResponseData()
->getResult();
$sections = $result->data();
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting entity sections: ' . $e->getMessage();
}
BX24.callMethod(
'entity.section.get',
{
ENTITY: 'menu_new',
SORT: {
'NAME': 'ASC'
}
},
function(result){
sections = result.data();
}
);
https://my.bitrix24.com/rest/entity.section.get.json?ENTITY=menu_new&SORT%5BNAME%5D=ASC&auth=9affe382af74d9c5caa588e28096e872
How to Use Examples in Documentation
Response in case of success
200 OK
{
"result":
[
{
"ID":"219",
"CODE":null,
"TIMESTAMP_X":"2013-06-23T10:11:59+02:00",
"DATE_CREATE":"2013-06-23T10:11:59+02:00",
"CREATED_BY":"1","MODIFIED_BY":"1",
"ACTIVE":"Y",
"SORT":"500",
"NAME":"Second test section",
"PICTURE":null,
"DETAIL_PICTURE":null,
"DESCRIPTION":null,
"LEFT_MARGIN":"1",
"RIGHT_MARGIN":"2",
"DEPTH_LEVEL":"1",
"ENTITY":"menu_new",
"SECTION":null
},
{
"ID":"218",
"CODE":null,
"TIMESTAMP_X":"2013-06-23T10:24:46+02:00",
"DATE_CREATE":"2013-06-23T10:08:54+02:00",
"CREATED_BY":"1",
"MODIFIED_BY":"1",
"ACTIVE":"Y",
"SORT":"500",
"NAME":"First test section",
"PICTURE":null,
"DETAIL_PICTURE":null,
"DESCRIPTION":null,
"LEFT_MARGIN":"3",
"RIGHT_MARGIN":"4",
"DEPTH_LEVEL":"1",
"ENTITY":"menu_new",
"SECTION":null
}
],
"total":2
}