예제 #1
0
        public IEnumerable <string> GetUsers(string match, int count)
        {
#if MEETING_TIMES
            MeetingTimes times = new MeetingTimes();

            MeetingTimeSlot timeSlot = new MeetingTimeSlot();
            timeSlot.Start = new TimeDesc("2015-10-08", "1:00:00", "GMT Standard Time");
            timeSlot.End   = new TimeDesc("2015-10-08", "23:00:00", "GMT Standard Time");

            AttendeeBase att1 = new AttendeeBase();
//            att1.EmailAddress.Address = "*****@*****.**";
            att1.EmailAddress.Address = "*****@*****.**";

            AttendeeBase att2 = new AttendeeBase();
            att2.EmailAddress.Address = "*****@*****.**";

            times.TimeConstraint.Timeslots.Add(timeSlot);
            times.LocationConstraint = new LocationConstraint();

            times.Attendees.Add(att1);
//            times.Attendees.Add(att2);

            var    httpProxy = new HttpUtilSync(Constants.OfficeResourceId);
            String uri       = "https://outlook.office365.com/api/beta/me/findmeetingtimes";

            var res = httpProxy.PostItem2 <MeetingTimes, MeetingTimeCandidates>(uri, times);

            return(null);
#else
            string uri = BaseUri + "users";
            uri += '?';     // we always have at least api version parameter

            if (string.IsNullOrEmpty(match) == false)
            {
                uri = AddFilters(uri, match,
                                 "userPrincipalName",
                                 "displayName",
                                 "givenName" /*, "surName"*/);

                uri += '&';
            }

            uri += ApiVersion;

            var users = new HttpUtilSync(Constants.AadServiceResourceId)
                        .GetItems <UserHttp>(uri, count);

            return(users.Select(x => x.UserPrincipalName));
#endif
        }
예제 #2
0
        public IEnumerable <string> GetUsers(string match, int count)
        {
            string uri = BaseUri + "users";

            uri += '?';     // we always have at least api version parameter

            if (string.IsNullOrEmpty(match) == false)
            {
                uri = AddFilters(uri, match,
                                 "userPrincipalName",
                                 "displayName",
                                 "givenName" /*, "surName"*/);

                uri += '&';
            }

            uri += ApiVersion;

            var users = new HttpUtilSync(Constants.AadServiceResourceId)
                        .GetItems <UserHttp>(uri, count);

            return(users.Select(x => x.UserPrincipalName));
        }