Get number of unread messages for a user

global $um_messaging;
$count = $um_messaging->api->get_unread_count( $user_id ); // user ID should be dynamically set