Skip to main content

getAdminsInfo

Getting all objects of user-administrators.

Description

This method retrieves user objects of type admin from the API. It returns a Promise that resolves to an array of IAdminEntity objects.

Admins.getAdminsInfo(

body, langCode, offset, limit

);

Parameters schema

Schema

body: AttributeType[]
Array of filter objects with search conditions. Default: []
example:

[
{
"attributeMarker": "num",
"conditionMarker": "mth",
"conditionValue": 1
},
{
"attributeMarker": "num",
"conditionMarker": "lth",
"conditionValue": 3
}
]

langCode: string
Language code. Default: "en_US"
example: "en_US"

offset: number
Parameter for pagination. Default: 0
example: 0

limit: number
Parameter for pagination. Default: 30
example: 30

By default, you can retrieve 10 objects. This is due to the record limit in the module's permissions settings.
For pagination to work correctly, you need to configure Module permissions according to your needs in the corresponding section.

Examples

Minimal example

const response = await Admins.getAdminsInfo();

Example with attributes


const body = [
{
"attributeMarker": "num",
"conditionMarker": "mth",
"conditionValue": 1
}
];

const response = await Admins.getAdminsInfo(body, "en_US", 0, 30);

Example response

[
{
"id": 1,
"attributeSetId": 27,
"identifier": "admin",
"attributeSetIdentifier": "admins",
"position": 1,
"isSync": true,
"attributeValues": {
"admin-text": {
"type": "string",
"value": "",
"position": 0,
"additionalFields": []
}
}
},
{
"id": 2,
"attributeSetId": 27,
"identifier": "Aleksandr",
"attributeSetIdentifier": "admins",
"position": 2,
"isSync": false,
"attributeValues": {}
},
{
"id": 4,
"attributeSetId": null,
"identifier": "developer_admin",
"attributeSetIdentifier": null,
"position": 3,
"isSync": false,
"attributeValues": {}
}
]

Response schema

Schema: IAdminEntity[]

id: number | null
The identifier of the object.
example: 1764

attributeSetId: number | null
The identifier of the attribute set being used.
example: 120

identifier: string
The textual identifier for the record field.
example: "admin1"

attributeSetIdentifier: string | null
The identifier of the attribute set.
example: "admins"

position: number | null
Position number (for sorting).
example: 1

isSync: boolean
Page indexing flag (true or false).
example: true

attributeValues: IAttributeValues
Array of attribute values from the index (presented as a pair of user attribute identifier: attribute value).
example:

[
{
"marker": {
"type": "string",
"value": "Some value"
}
}
]