Open PeterArcurve opened 2 years ago
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(...)
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(....))
orAppointment.Bind(....)
orewsService.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)
})
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 useappointmentItem.Load(new propertySet(....))
orAppointment.Bind(....)
orewsService.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
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?