Homepage / Doc / Get User Data

Get User Data

The GetUserData method can be utilized to pull all user information ( except password ). This includes group memberships, whether the user is locked out, their email, their user type, their roles, and if they have opted out of any email invitations.

class Test
{
    static void Main()
    {
        var client = new UserManagementServiceClient();

        var userRequest = client.GetUserData(authToken, "admin");

        if (!userRequest.CallSuccess)
        {
            Console.WriteLine(userRequest.FailureMessage);
            return;
        }

        var userData = userRequest.ResultData;

        Console.WriteLine("Username:  {0} | Email: {1} | First Name: {2}", userData.UniqueIdentifier, userData.Email, userData.Profile.NameValueList[0].Value);
        Console.WriteLine("User has the following roles : ");

        //Get role data
        if (userData.RoleMemberships != null)
        {
            foreach (var role in userData.RoleMemberships)
            {
                Console.WriteLine(role);
            }
        }

        //Always close the client
        client.Close();
    }
}

 

Input Parameters

Parameter Type Description
authToken string Authentication token to validate permission over the data requested
userName string Username to pull the data for
November 15, 2016