Esempio n. 1
0
        public void CanGetAllUsers()
        {
            var client = new HipchatClient();

            var users = client.GetAllUsers();

            Assert.NotNull(users);
        }
Esempio n. 2
0
        public static List <string> GetAllUsers(string token)
        {
            HipchatClient client             = new HipchatClient(token);
            HipchatGetAllUsersResponse users = client.GetAllUsers();
            List <string> UserNames          = new List <string>();

            foreach (HipchatUser user in users.Items)
            {
                UserNames.Add(user.Name);
            }

            return(UserNames);
        }
Esempio n. 3
0
        public static void SendPM(string message, string username, string token)
        {
            try
            {
                HipchatClient client             = new HipchatClient(token);
                HipchatGetAllUsersResponse users = client.GetAllUsers();

                foreach (HipchatUser user in users.Items)
                {
                    if (user.Name == username)
                    {
                        client.PrivateMessageUser(user.Id.ToString(), message, true, HipchatMessageFormat.Text);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }