Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Appointment Organizer and Attendee #392

Open
PeterArcurve opened this issue Dec 3, 2021 · 3 comments
Open

Get Appointment Organizer and Attendee #392

PeterArcurve opened this issue Dec 3, 2021 · 3 comments

Comments

@PeterArcurve
Copy link

PeterArcurve commented Dec 3, 2021

FindAppointments can be used to get appointments which contains an Organizer and RequiredAttendees.

Organizer has EmailAddress but the object doesn't contain anything that resembles an email address. Instead it has something like this address = "/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=CE11C450489142DEBA5DBFD9D07C8105-JEROS SHARE/"

RequiredAttendess is always coming back empty even though Outlook indicates there are several required attendees.

How do get the organizer and requiredAttendee email addresses?

@gautamsi
Copy link
Owner

gautamsi commented Dec 3, 2021

FindAppointments does not bring down all the properties of item, This is due to nature of search request and controlled by server side of ews.

to get more properties or even load full email address, you want to either use appointmentItem.Load(new propertySet(....)) or Appointment.Bind(....) or ewsService.LoadPropertiesForItems(...)

@roy2651
Copy link

roy2651 commented May 18, 2022

FindAppointments does not bring down all the properties of item, This is due to nature of search request and controlled by server side of ews.

to get more properties or even load full email address, you want to either use appointmentItem.Load(new propertySet(....)) or Appointment.Bind(....) or ewsService.LoadPropertiesForItems(...)

how to use Appointment.Bind(....) such api to get appointment.RequiredAttendees

exch.ImpersonatedUserId = new ews.ImpersonatedUserId(ews.ConnectingIdType.SmtpAddress, xxxx@xxx.com');
var view = new ews.CalendarView(ews.DateTime.Now.Add(-1, "week"), ews.DateTime.Now.Add(1, 'week'));
exch.FindAppointments(ews.WellKnownFolderName.Calendar, view).then(response => {
    let appointments = response.Items;
    for (let appointment of appointments) {
        // console.log(appointment)
        ews.Appointment.Bind(exch, new ews.ItemId(appointment.Id.UniqueId),
                                               new ews.PropertySet(ews.AppointmentSchema.Subject,
                                               ews.AppointmentSchema.Location, 
                                               ews.AppointmentSchema.RequiredAttendees, 
                                               ews.AppointmentSchema.Start,
                                               ews.AppointmentSchema.End, 
                                               ews.AppointmentSchema.Organizer)).then(() => {
                                                                    console.log('Organizer:', appointment.Organizer.name)
                                                                    console.log("Subject: ", appointment.Subject);
                                                                     console.log("Location: ", appointment.Location);
                                                                     let start = appointment.Start.Format('YYYY-MM-DD HH:mm:ss')

                                                                     let end = appointment.End.Format('YYYY-MM-DD HH:mm:ss')

                                                                     console.log("Start: ", start);

                                                                      console.log("End: ", end);
                                                                      appointment.RequiredAttendees.Items.forEach((a) => {
                                                                                 console.log(a.Address);
                                                                       });
                                                  })


    }

}).catch(err => {
    console.log('err:', err)
})   

@roy2651
Copy link

roy2651 commented May 20, 2022

FindAppointments does not bring down all the properties of item, This is due to nature of search request and controlled by server side of ews.
to get more properties or even load full email address, you want to either use appointmentItem.Load(new propertySet(....)) or Appointment.Bind(....) or ewsService.LoadPropertiesForItems(...)

how to use Appointment.Bind(....) such api to get appointment.RequiredAttendees

exch.ImpersonatedUserId = new ews.ImpersonatedUserId(ews.ConnectingIdType.SmtpAddress, xxxx@xxx.com');
var view = new ews.CalendarView(ews.DateTime.Now.Add(-1, "week"), ews.DateTime.Now.Add(1, 'week'));
exch.FindAppointments(ews.WellKnownFolderName.Calendar, view).then(response => {
    let appointments = response.Items;
    for (let appointment of appointments) {
        // console.log(appointment)
        ews.Appointment.Bind(exch, new ews.ItemId(appointment.Id.UniqueId),
                                               new ews.PropertySet(ews.AppointmentSchema.Subject,
                                               ews.AppointmentSchema.Location, 
                                               ews.AppointmentSchema.RequiredAttendees, 
                                               ews.AppointmentSchema.Start,
                                               ews.AppointmentSchema.End, 
                                               ews.AppointmentSchema.Organizer)).then(() => {
                                                                    console.log('Organizer:', appointment.Organizer.name)
                                                                    console.log("Subject: ", appointment.Subject);
                                                                     console.log("Location: ", appointment.Location);
                                                                     let start = appointment.Start.Format('YYYY-MM-DD HH:mm:ss')

                                                                     let end = appointment.End.Format('YYYY-MM-DD HH:mm:ss')

                                                                     console.log("Start: ", start);

                                                                      console.log("End: ", end);
                                                                      appointment.RequiredAttendees.Items.forEach((a) => {
                                                                                 console.log(a.Address);
                                                                       });
                                                  })


    }

}).catch(err => {
    console.log('err:', err)
})   

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants