static void Main(string[] args) { string[] userName = new string[5]; string[] userPassword = new string[5]; string[] consumerKey = new string[5]; int i; userName[0] = "*****@*****.**"; userPassword[0] = "apprenticeship123"; consumerKey[0] = " deUbbIVOpyiHCpA10ogMAI5VWMJ7GDNb"; userName[1] = "*****@*****.**"; userPassword[1] = "chocolatemuffin01"; consumerKey[1] = " deUbbIVOpyiHCpA10ogMAI5VWMJ7GDNb"; userName[2] = "*****@*****.**"; userPassword[2] = "blueberrymuffin02"; consumerKey[2] = " deUbbIVOpyiHCpA10ogMAI5VWMJ7GDNb"; userName[3] = "*****@*****.**"; userPassword[3] = "Chocolate18"; consumerKey[3] = " deUbbIVOpyiHCpA10ogMAI5VWMJ7GDNb"; userName[4] = "*****@*****.**"; userPassword[4] = "password123"; consumerKey[4] = " deUbbIVOpyiHCpA10ogMAI5VWMJ7GDNb"; var authApi = new AuthenticationApi(); for (i = 0; i < 5; i++) { try { var response = authApi.directLogin(userName[i], userPassword[i], consumerKey[i], "password"); var accessToken = response.access_token; var meetingsApi = new MeetingsApi(); var meetings = meetingsApi.getUpcomingMeetings(accessToken); foreach (var m in meetings) { Console.WriteLine("{0}|{1}|{2}|{3}", userName[i], m.meetingId, m.startTime, m.subject); } } catch { // Stop error on screen } } }
public IEnumerable <MeetingWithOrganizerAndAttendees> GetMeetings() { var meetings = new List <LogMeIn.GoToMeeting.Api.Model.MeetingById>(); try { var historicalMeetings = MeetingsApi.getHistoricalMeetings(accessToken, new System.DateTime(1, 1, 1), new System.DateTime(9999, 12, 31)); foreach (var meeting in historicalMeetings) { meetings.Add(MeetingsApi.getMeeting(accessToken, long.Parse(meeting.meetingId)).First()); } } catch (Exception e) { _log.Error(() => e.Message); } try { var upcomingMeetings = MeetingsApi.getUpcomingMeetings(accessToken); foreach (var meeting in upcomingMeetings) { meetings.Add(MeetingsApi.getMeeting(accessToken, long.Parse(meeting.meetingId)).First()); } } catch (Exception e) { _log.Error(() => e.Message); } foreach (var meeting in meetings) { var meet = new MeetingWithOrganizerAndAttendees(); meet.Meeting = meeting; meet.Attendees = new List <LogMeIn.GoToMeeting.Api.Model.AttendeeByMeeting>(); if (meeting.endTime < System.DateTime.Now) { List <LogMeIn.GoToMeeting.Api.Model.AttendeeByMeeting> attendees = null; try { attendees = MeetingsApi.getAttendeesByMeetings(accessToken, meeting.meetingId); } catch (Exception) { Console.WriteLine("Could not get attendee"); } if (attendees == null) { continue; } foreach (var attendee in attendees) { meet.Attendees.Add(attendee); if (attendee.email == null) { continue; } // attendee.email gives email of meeting organizer var organizer = OrganizersApi.getOrganizersAllOrByEmail(accessToken, attendee.email); meet.Organizer = organizer.First(); var result = organizer.First(); } } yield return(meet); } }