Creating/updating users in SoftExpert Administration
This tutorial aims to provide a brief demonstration on how to create or update a user in SoftExpert Administration. It is not a thorough guide on integrations, but rather a practical illustration for request creation.
Introduction​
In order for a user to be able to log in to SoftExpert Suite, they must be registered in SoftExpert Administration with required information such as login, ID, name, department/position, and access group.
In this example, we will cover the user method to create or update users, providing only the parameters required for the authentication.
This method allows inserting or editing:
- General user data;
- Departments and positions (ID # and name);
- Relationship between user, department/position/team/access group;
- Relationship between user and domain controller.
If the user exists already (with a previously created ID), their information
will be updated and replaced with those present in the request. If value 1
is
inserted in the UpdateType
attribute, the attributes of the "List" type will
be replaced with those present in the request. If no value or 0
is inserted,
the values will be added to those already created in the system.
Resource URL​
POST /apigateway/v1/administration/user
Example​
Parameters that will be sent to the example request​
This section describes the parameters that must be sent to an example request in order for a user to be created in the system. The attributes include information such as user ID, name, login, password, language, activity status, e-mail address, access groups, department and position, as well as update type.
The table lists each necessary attribute, its type and description, in addition to specifying whether it is mandatory or not. A request example is provided in JSON format, showing how the attributes must be structured and sent in the request.
Attributes that will be set in this example:
Request Body Parameter | Type | Required | Description |
---|---|---|---|
UserId | String | Yes | User ID. |
UserName | String | Yes | User name. |
UserLogin | String | Yes | Name the user is given in order to log in to the system. |
UserPassword | String | Yes | User password. |
UserLanguage | Integer | No | Enter the user language code, in accordance with the "Database encoding" column of the "Localization" section, in the System requirements document. |
IsActive | Integer | No | Enabled user (1 - Enabled, 0 - Disabled). |
IsEnabled | Integer | No | Blocked user (1 - Blocked, 0 - Unblocked). |
UserEmail | String | Yes | User e-mail address. |
AccGroupIdArray | String | No | List of access group identifiers; separated by comma, if you want to add more than one. |
DeptPosArray.DeptPos.DepartmentID | String | No | Department ID #. |
DeptPosArray.DeptPos.DepartmentName | String | No | Department title. |
DeptPosArray.DeptPos.PositionID | String | No | Position ID #. |
DeptPosArray.DeptPos.PositionName | String | No | Department title. |
UpdateType | Integer | No | Definition of how the lists of values of the AccGroupIdArray, DeptPosArray and TeamIdArray parameters will be considered in user import. |
Request example:
curl 'https://my-domain.softexpert.com/apigateway/v1/administration/user' \
-H 'Content-Type: application/json' \
-H 'Authorization: <your_api_token>' \
-d '{
"UserId": "jpascal",
"UserName": "João Pascal",
"UserLogin": "jpascal",
"UserPassword": "14UwDX2S9&1u",
"UserLanguage": "1",
"IsActive": 1,
"IsEnabled": 0,
"UserEmail": "jpascal@softexpert.com",
"AccGroupIdArray": "FULL",
"DeptPosArray": {
"DeptPos": {
"DepartmentID": "MKT.D.01",
"DepartmentName": "Marketing Division",
"PositionID": "MKT.P.01",
"PositionName": "Marketing Director"
}
},
"UpdateType": "1"
}' -X POST
Upon first access, the user will need to update their password. It is of paramount importance for the user to know the first password sent during the creation request. This measure ensures the security and integrity of their information.
Response example:
{
"UserId": "jpascal",
"Status": "Success",
"Detail": "Record successfully added"
}
Further considerations​
- Additional fields: If you want to insert additional fields in the user record, make sure to check the SoftExpert Administration API documentation in order to learn about all available parameters.
- Password validation: When creating or updating a user, remember that the provided password must meet the complexity requirements set by your organization's security policy.
- System requirements: Before creating or updating users in SoftExpert Suite, make sure your installation meets all system requirements. Refer to the official documentation for more information.
- Access permissions: Any user that creates users must have the adequate permissions to execute user creation and update actions in SoftExpert Suite. Otherwise, contact the system administrator.
- Error treatment: If an error occurs during the creation or update of a user, check the error messages and try fixing the problem before another attempt.