Getting User Settings
Function : get_user_settings()
Purpose
This function retrieves the complete configuration and preference settings for a specific user. It includes profile information, dashboard preferences, enabled dashboards, and detailed display/module settings that control which features and modules are visible and enabled for the user.
Parameters
| Parameter | Type | Description |
|---|---|---|
| user | String | Unique identifier (UUID) of the user whose settings are to be retrieved |
Use Case
The function is used to fetch user-specific configuration data to personalize the application experience. It allows the system to load user profile details and timezone settings, identify accessible dashboards and the default dashboard, control the visibility and ordering of application modules such as Orders, Invoices, Payments, and Reports, and apply user-specific UI preferences and feature access rules in a structured and consistent format.
def test_get_user_settings():
SDKConfig.PRINT_REQUEST_DATA = True
SDKConfig.PRINT_RAW_RESPONSE = False
token_file_path = "shared_token.json"
file_token_mgr = FileTokenManager(token_file_path)
exsited_sdk: ExsitedSDK = ExsitedSDK().init_sdk(
request_token_dto=CommonData.get_request_token_dto(),
file_token_mgr=file_token_mgr
)
try:
response = exsited_sdk.setting.get_user_settings(uuid='User_UUID')
print(response)
except ABException as ab:
print(ab)
print(ab.get_errors())
print(ab.raw_response)
public function testReadUserSettings()
{
$userUuid = 'User_UUID';
try {
$response = $this->userSettingsService->readUserSettings($userUuid, 'v2');
echo '<pre>' . json_encode($response, JSON_PRETTY_PRINT) . '</pre>';
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
}
Response
The function returns an object containing user-specific settings and configuration details. The response includes profile information such as name, email, image URL, and timezone, along with dashboard preferences including enabled dashboards and the default dashboard selection. It also provides detailed display settings that define the visibility, order, and default custom forms for application modules such as Orders, Invoices, Payments, Reports, and other functional areas.
