Модель Role — представляет роли пользователей
* @property integer $id // ИД * @property string $name // Название телефон * @property integer $super(0,1) // Особые привилегии, неограниченный доступ
Создание роли
curl --location --request POST 'https://{DOMAIN NAME}/rest/api/Role' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'
--data-raw '{
"name": "роль2",
"super": "0"
}'Ответ сервера
{
"success": true,
"message": "Record(s) Created",
"data": {
"totalCount": 1,
"role": [
{
"super": "0",
"name": "роль2",
"id": "13"
}
]
}
}Получение роли по ИД
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Role/2' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Record Retrieved Successfully",
"data": {
"totalCount": 1,
"role": {
"id": "2",
"name": "Врач",
"super": "0"
}
}
}Получение ролей
curl --location --request GET 'https://{DOMAIN NAME}/rest/api/Role' \
--header 'Content-Type: application/json' \
--header 'X-REST-API-KEY: {REST API KEY}'Ответ сервера
{
"success": true,
"message": "Records Retrieved Successfully",
"data": {
"totalCount": "8",
"role": [
{
"id": "2",
"name": "Врач",
"super": "0"
},
{
"id": "4",
"name": "Регистраторы",
"super": "0"
},
{
"id": "5",
"name": "Ассистенты врачей",
"super": "0"
},
{
"id": "7",
"name": "Админы",
"super": "1"
},
{
"id": "8",
"name": "Руководитель",
"super": "0"
},
{
"id": "9",
"name": "Бухгалтер",
"super": "0"
},
{
"id": "10",
"name": "Лаборант",
"super": "0"
},
{
"id": "11",
"name": "Грумер",
"super": "0"
}
]
}
}