Пример #1
0
        //[Fact]
        public void GenerateAuthTokenWithUsernameAndPassword()
        {
            //insert your username and password here
            const string username = "";
            const string password = "";

            var client = new HipchatClient("YourToken");

            var token = client.GenerateToken(GrantType.Password, Enumerable.Empty <TokenScope>(),
                                             username, password: password);

            Assert.NotNull(token);
        }
Пример #2
0
        public void GenerateTokenExample()
        {
            var client = new HipchatClient();

            var token = client.GenerateToken(GrantType.ClientCredentials,
                                             new List <TokenScope>
            {
                TokenScope.SendNotification,
            },
                                             "", /*Auth Id*/
                                             "" /*Auth Secret*/);

            Assert.NotNull(token);
        }
Пример #3
0
        //[Fact]
        public void GenerateAuthToken()
        {
            //insert your authId and auth Secret here
            const string authId     = "";
            const string authSecret = "";

            var client = new HipchatClient();

            var token = client.GenerateToken(GrantType.ClientCredentials,
                                             new List <TokenScope> {
                TokenScope.SendNotification
            }, authId, authSecret);

            Assert.NotNull(token);
        }