Administrating users and profiles using beqom APIs
This article details the use of the user profile admin APIs. The admin service is used to manage users and profiles in the beqom v10 application.
Properties related to the "User" object
The table below describes the properties related to user-type objects:
| Parameter | Description |
|---|---|
id_user |
PRIMARY KEY This is a unique integer number corresponding to each user used in API operations. |
id_external_user |
Payee ID in This property is not mandatory. |
firstname_user |
First name of the user |
lastname_user |
Last name of the user |
login_user |
Unique name of the user (generally the combination first name + last name is used) |
password_user |
Effective only in development environments. This property is not mandatory. |
isadmin_user |
If the value of this property is Only a user who has been granted Super Admin rights can set the value of this property to |
active_user |
If the value of this property is 0, then the user can no longer access the beqom application. |
mail_user |
E-mail address of the user to be used to send notifications from the beqom application. This property is not mandatory. |
idExternalSSO |
Passport UID |
Properties Related to the "Profile" Object
The table below describes the properties related to profile-type objects:
| Property | Description |
|---|---|
id_profile |
PRIMARY KEY This is a unique integer number corresponding to each profile used in API operations. |
name_profile |
Name of the profile If a key is used for the name of a profile, it can then be translated in the |
id_home_page |
Defines the type of home page to be used for the profile. The beqom application allows different types of home pages, such as SSRS reports or HTML content Foreign key to The default home page value is |
id_module_landing |
Defines to which component users who are granted this profile are directed when accessing the beqom application. Possible values are the following:
|
access_ui |
This property defines the user interfaces to which the profile has access. Possible values are the following:
|
Deleting a User
Use the following method to delete a user from the system.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/DELETE /api/admin/DeleteUser | DELETE | userId (id_user parameter in the k_users table) | - |
Retrieving all the profiles of a user
Use the following method to obtain the list of all the profiles to which a user is assigned.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET /api/admin/GetAllUserProfiles | GET | userId (id_user parameter in the k_users table) | - |
Sample Output
[
{
"accessui": 3,
"dataType": "",
"id": "-1",
"isdisabled": false,
"isselected": true,
"name": "GV_Administrator"
}
]The following table details the parameters returned in the output of the method:
| Parameter | Description |
|---|---|
| id | id_profile value in the k_profiles table |
| dataType |
NOT USED Always empty string |
| accessui | accessui value in the k_profiles table |
| isdisabled | Is the profile currently disabled by maintenance mode |
| isselected |
NOT USED Always True |
| name | Name of the profile in the k_profiles table. |
Creating or editing a user
Use the following method to create a user or save changes to a user.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST/api/Admin/SaveUserById | POST |
|
- |
Sample output
1 -> {k_users id_user value of user saved}Configuring the profiles assigned to a user
Use the following method to attribute one or several profiles to a user.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST /api/Admin/ConfigureUsersProfiles | POST |
|
- |
Retrieving the profiles assigned to a user
Use the following method to obtain the list of all profiles assigned to a user.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET /api/Admin/GetProfiles | GET | - | - |
Sample Output
[
{
"id": -1,
"text": "GV_Administrator"
}
]The following table details the parameters returned in the output of the method:
| Parameter | Description |
|---|---|
| id | id_profile value in the k_profiles table |
| text | Name of the profile in the k_profiles table |
Creating or editing a profile
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST /api/Admin/SaveProfile | POST | - |
Copy |
The following table details the parameters that can be used in the body of the method:
| Parameter | Description |
|---|---|
| idProfile | Id of the profile. If the value is 0, then a new profile is created |
| profileName | Name of the profile in the k_profiles table |
| comment | Comment |
| idHomePage | |
| idModuleLanding | |
| accessUI |
Sample Output
“-1” ->{idProfile value of the modified profile in the k_profiles table}Deleting a profile
Use the following method to delete a profile from the system.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/DELETE /api/Admin/SaveProfile | DELETE | -idProfile : id_profile value in the k_profiles table |
Retrieving all the available components for the logged in user
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET/api/admin/GetAllTabs | GET | - | - |
Sample Output
[
{
"module_id": -1,
"module_name": "Tb_home"
},
{
"module_id": -2,
"module_name": "Tb_admin"
}
]The following table details the paramters returned in the output of the method:
| Parameter | Description |
|---|---|
| module_id | id_module value in the k_modules table |
| module_name | name_module value in the k_modules table |
Updating the rights of a profile
Use the following method to change the permissions of a profile.
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST /api/admin/UpdateProfileRights | POST | - |
List<KeyValuePair<int, List<KeyValuePair<int, bool>>>>
Copy
|
Sample Output
“Success”Retrieving detailed information about a profile
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET /api/admin/GetProfileDetail | GET | idProfile : id_profile value in the k_profiles table | - |
Sample Output
{
"access_ui": 3,
"comments_profile": "string",
"home_page": -1,
"landing_page": -2,
"name_profile": "GV_Administrator"
}The following table details the parameters returned in the output of the method:
| Parameter | Description |
|---|---|
| access_ui | |
| profileName | |
| comment_profile | Comment |
| home_page | |
| landing_page | |
| name_profile | Name of the profile in the k_profiles table |
Retrieving the module rights of a profile
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/GET /api/admin/GetModuleRightsByProfileId | GET |
|
- |
Sample Output
[
{
"id": -1,
"isPermitted": false,
"name": "EXC_read"
}
]The following table details the parameters returned in the output of the method:
| Parameter | Description |
|---|---|
| id | id_rightvalue in the k_rights table |
| isPermitted | |
| name | name_right value in the k_rights table |
Updating module visibility for a profile
| Endpoint | Action | Input | Body |
|---|---|---|---|
| {ServiceURL}/POST /api/admin/UpdateModuleDisplay | POST |
|
- |
Sample Output
“Success”HTTP Output
Standard HTTP output
200 Succeeded
401 Unauthorized
404 Not found
500 Internal error