Creates an instance of UserPreference
The Webex SDK instance
Function to get the current user's CI user ID
Private getPrivate metricsPrivate webexPrivate webexCreates new user preferences
The user preference data to create
Promise resolving to created user preferences
If the API call fails
const newPreferences = await userPreferenceAPI.createUserPreference({
userId: 'user123',
preferences: { e911Reminder: true, notificationSettings: { email: true } }
});
Deletes user preferences for a specific user
User ID to delete preferences for
Promise resolving when deletion is complete
If the API call fails
await userPreferenceAPI.deleteUserPreference('user123');
Fetches user preferences for a specific user
Optional params: GetUserPreferenceParamsOptional parameters for fetching preferences
Promise resolving to user preferences
If the API call fails
// Get preferences for current user
const preferences = await userPreferenceAPI.getUserPreference();
// Get preferences for a specific user
const preferences = await userPreferenceAPI.getUserPreference({ userId: 'user123' });
// Get preferences with pagination
const preferences = await userPreferenceAPI.getUserPreference({ page: 0, pageSize: 50 });
Updates existing user preferences
User ID to update preferences for
The user preference data to update
Promise resolving to updated user preferences
If the API call fails
const updatedPreferences = await userPreferenceAPI.updateUserPreference('user123', {
preferences: { e911Reminder: false }
});
UserPreference API class for managing Webex Contact Center user preferences. Provides functionality to get, create, update, and delete user preferences.
UserPreference
Example