Get the list of storage items entity.item.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
Description
The method entity.item.get retrieves a list of storage items. 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 |
Similar to the arOrder and arFilter parameters of the PHP method |
|
FILTER |
Similar to the arOrder and arFilter parameters of the PHP method |
|
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.item.get',
{
ENTITY: 'menu',
SORT: {
DATE_ACTIVE_FROM: 'ASC',
ID: 'ASC'
},
FILTER: {
'>=DATE_ACTIVE_FROM': dateStart,
'<DATE_ACTIVE_FROM': dateFinish
}
}
);
const result = response.getData().result;
this.buildData(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'entity.item.get',
[
'ENTITY' => 'menu',
'SORT' => [
'DATE_ACTIVE_FROM' => 'ASC',
'ID' => 'ASC'
],
'FILTER' => [
'>=DATE_ACTIVE_FROM' => $dateStart,
'<DATE_ACTIVE_FROM' => $dateFinish
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your required data processing logic
$this->buildData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error getting entity items: ' . $e->getMessage();
}
BX24.callMethod(
'entity.item.get',
{
ENTITY: 'menu',
SORT: {
DATE_ACTIVE_FROM: 'ASC',
ID: 'ASC'
},
FILTER: {
'>=DATE_ACTIVE_FROM': dateStart,
'<DATE_ACTIVE_FROM': dateFinish
}
},
$.proxy(
this.buildData,
this
)
);
https://my.bitrix24.com/rest/entity.item.get.json?=&ENTITY=menu&FILTER%5B%3CDATE_ACTIVE_FROM%5D=2013-07-01T00%3A00%3A00.000Z&FILTER%5B%3E%3DDATE_ACTIVE_FROM%5D=2013-06-24T00%3A00%3A00.000Z&SORT%5BDATE_ACTIVE_FROM%5D=ASC&SORT%5BID%5D=ASC&auth=723867cdb1ada1de7870de8b0e558679
Example of a call with a complex filter
try
{
const response = await $b24.callMethod(
'entity.item.get',
{
ENTITY: 'menu',
SORT: {
DATE_ACTIVE_FROM: 'ASC',
ID: 'ASC'
},
FILTER: {
'1':{
'LOGIC':'OR',
'PROPERTY_MYPROP1':'value1',
'PROPERTY_MYPROP2':'value2'
}
}
}
);
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.get',
[
'ENTITY' => 'menu',
'SORT' => [
'DATE_ACTIVE_FROM' => 'ASC',
'ID' => 'ASC'
],
'FILTER' => [
'1' => [
'LOGIC' => 'OR',
'PROPERTY_MYPROP1' => 'value1',
'PROPERTY_MYPROP2' => 'value2'
]
]
]
);
$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 getting entity items: ' . $e->getMessage();
}
BX24.callMethod(
'entity.item.get',
{
ENTITY: 'menu',
SORT: {
DATE_ACTIVE_FROM: 'ASC',
ID: 'ASC'
},
FILTER: {
'1':{
'LOGIC':'OR',
'PROPERTY_MYPROP1':'value1',
'PROPERTY_MYPROP2':'value2'
}
}
}
);
How to Use Examples in Documentation
Response in case of success
200 OK
{
"result":
[
{
"ID":"838",
"TIMESTAMP_X":"2013-06-25T15:06:47+02:00",
"MODIFIED_BY":"1",
"DATE_CREATE":"2013-06-25T15:06:47+02:00",
"CREATED_BY":"1",
"ACTIVE":"Y",
"DATE_ACTIVE_FROM":"2013-07-01T03:00:00+02:00",
"DATE_ACTIVE_TO":"",
"SORT":"500",
"NAME":"Buckwheat in the shell",
"PREVIEW_PICTURE":null,
"PREVIEW_TEXT":null,
"DETAIL_PICTURE":null,
"DETAIL_TEXT":null,
"CODE":null,
"ENTITY":"menu",
"SECTION":null,
"PROPERTY_VALUES":
{
"dish":"813",
"price":"16"
}
}
],
"total":1
}