0
votes

I'm brand new to using the Exchange EWS and haven't been able to find any reference to this in the documentation or online.

I'm connecting to my Exchange 2007 server and retrieving a list of calendar meetings for a given account using PHP SoapClient. This is working and is retrieving all the meetings as CalendarItem objects that I can then use in my PHP script.

However, the thing that I really need is to know who has accepted to attend the meetings. I gather that the DisplayTo property of the CalendarItem object tells us who has been invited, but surely some of them could have declined. So, if I want to know who will actually be there, how can I get this information?

This would seem like useful information to make available (e.g. to plan catering or whatever) so it seems unlikely that it would not be exposed through the web service, but I cannot find out how to discover this information.

Can anyone help?

edit: Just to clarify what is returned by the Exchange 2007 web service, this is what the service returns for each meeting:

[0] => stdClass Object
        (
            [ItemId] => stdClass Object
                (
                    [Id] => AAAQAHN0ZXBld0BNQkEuYWMud
                    [ChangeKey] => DwAAABYA
                )

            [ParentFolderId] => stdClass Object
                (
                    [Id] => AQAQAHN0ZXBld0BNQkEuYWM
                    [ChangeKey] => AQ
                )

            [ItemClass] => IPM.Appointment.Occurrence
            [Subject] => IT Meeting
            [Sensitivity] => Normal
            [DateTimeReceived] => 2013-09-11T13:06:27Z
            [Size] => 6724
            [Importance] => Normal
            [IsSubmitted] => 
            [IsDraft] => 
            [IsFromMe] => 
            [IsResend] => 
            [IsUnmodified] => 
            [DateTimeSent] => 2013-09-11T13:06:27Z
            [DateTimeCreated] => 2013-09-11T13:06:27Z
            [ReminderDueBy] => 2014-08-04T10:30:00Z
            [ReminderIsSet] => 1
            [ReminderMinutesBeforeStart] => 15
            [DisplayCc] => 
            [DisplayTo] => Bob, Frank, Tim, Alf, Juanita
            [HasAttachments] => 
            [Culture] => en-US
            [Start] => 2014-06-02T10:30:00Z
            [End] => 2014-06-02T12:00:00Z
            [IsAllDayEvent] => 
            [LegacyFreeBusyStatus] => Busy
            [Location] => Meeting Room
            [IsMeeting] => 1
            [IsRecurring] => 1
            [MeetingRequestWasSent] => 
            [IsResponseRequested] => 1
            [CalendarItemType] => Occurrence
            [MyResponseType] => Accept
            [Organizer] => stdClass Object
                (
                    [Mailbox] => stdClass Object
                        (
                            [Name] => Bob
                        )

                )

            [Duration] => PT1H30M
            [TimeZone] => (UTC) Dublin, Edinburgh, Lisbon, London
            [AppointmentReplyTime] => 2013-09-11T13:07:00Z
            [AppointmentSequenceNumber] => 0
            [AppointmentState] => 3
            [ConferenceType] => 0
            [AllowNewTimeProposal] => 1
            [NetShowUrl] => 
        )
3

3 Answers

1
votes

You can loop through the attendees in an appointment and check what their response type is. I have written an extended block of code for you to help you understand. I hope this helps :)

Appointment existingAppointment;

int acceptCount = 0;

if (existingAppointment.RequiredAttendees.Count > 0)
{
    foreach(Attendee att in existingAppointment.RequiredAttendees)
    {
        if ((att.ResponseType.HasValue) && (att.ResponseType.Value == MeetingResponseType.Accept))
        {
            acceptCount++;
        }
    }
}
1
votes

This answer is a tentative solution, but it seems to be working as far as I can tell.

So, to form a SOAP request using the PHP SOAPClient to get the appointment details for each appointment, as shown in the original question, I use the following:

//Loop through each CalendarItem in the CalendarItems collection
//Using a "by reference" pointer as I want to add the extra information to the original object.
foreach($calendaritems as &$b){
    $NewSearch->Traversal = "Shallow";
    $NewSearch->ItemShape->BaseShape = "AllProperties";
    $NewSearch->ItemIds->ItemId = $b->ItemId;
    $result = $client->GetItem($NewSearch);

    //add the RequiredAttendees element to the original calendar item, just for convenience
    $b->RequiredAttendees = $result->ResponseMessages->GetItemResponseMessage->Items->CalendarItem->RequiredAttendees;
}

However, it seems that you can only view the ResponseType for meeting requests that the account you're connecting as was the organiser for. All other meetings show as "Unknown" as the ResponseType.

0
votes

You'll need to count the number of attendees that have a MeetingResponseType of Accept. See this similar post: Count the number of attendees, that have accepted a meeting with EWS.