0
votes

Using EWS operations so far I'm able to get all the meetings in a time range. How do I get the attendees of a meeting?

I've read here that I can send an additional request with the meeting id in order to get additional properties (LoadPropertiesForItem).

What's the corresponding SOAP operation?

Thanks

private String getXMLRequestForRetrieve( DateTime start, DateTime end, String meetingRoomEmailToQuery ){

    return ""+
        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:typ=\"http://schemas.microsoft.com/exchange/services/2006/types\" xmlns:mes=\"http://schemas.microsoft.com/exchange/services/2006/messages\">"+
           "<soapenv:Header>"+
              "<typ:RequestServerVersion Version=\"Exchange2016\"/>"+
              "<typ:MailboxCulture>en-US</typ:MailboxCulture>"+
              "<typ:TimeZoneContext>"+
                "<typ:TimeZoneDefinition Id=\"W. Europe Standard Time\"/>"+
              "</typ:TimeZoneContext>"+
           "</soapenv:Header>"+
           "<soapenv:Body>"+
              "<mes:FindItem Traversal=\"Shallow\">"+
                 "<mes:ItemShape>"+
                    "<typ:BaseShape>AllProperties</typ:BaseShape>"+ // AllProperties, IdOnly
                    "<typ:AdditionalProperties>"+
                      "<typ:FieldURI FieldURI=\"item:Subject\" /> "+
                      "<typ:FieldURI FieldURI=\"item:DateTimeCreated\" />"+
                      "<typ:FieldURI FieldURI=\"item:Sensitivity\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:Start\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:End\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:IsCancelled\" />"+
                      "<typ:FieldURI FieldURI=\"calendar:Organizer\"/>"+
                      // "<typ:FieldURI FieldURI=\"item:Body\" />"+
                      // "<typ:FieldURI FieldURI=\"calendar:RequiredAttendees\"/>"+
                    "</typ:AdditionalProperties>"+
                 "</mes:ItemShape>"+
                 "<mes:CalendarView MaxEntriesReturned=\"1000\""+
                        " StartDate=\""+start.toString(patternFormat)+
                        "\" EndDate=\""+end.toString(patternFormat)+"\"/>"+ // 2016-06-10T07:00:00Z
                 "<mes:ParentFolderIds>"+
                   "<typ:DistinguishedFolderId Id=\"calendar\">"+
                     "<typ:Mailbox>"+
                       "<typ:EmailAddress>"+meetingRoomEmailToQuery+"</typ:EmailAddress>"+
                     "</typ:Mailbox>"+
                   "</typ:DistinguishedFolderId>"+
                "</mes:ParentFolderIds>"+
              "</mes:FindItem>"+
           "</soapenv:Body>"+
        "</soapenv:Envelope>";
}
2

2 Answers

1
votes

You need to make an EWS GetItem request https://msdn.microsoft.com/en-us/library/office/aa566013(v=exchg.150).aspx , If you have multiple Items your trying to do this on you can batch the GetItem request to make it more efficient.

0
votes

I solved with this SOAP request:

    private String getXMLReqForMeetingProperties(String itemId, String changeKey) { 

        return ""+
            "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+
            "<soap:Envelope "+
                "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "+
                "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "+
                "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" "+
                "xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\" "+
                "xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">"+
                "<soap:Header>"+
                   "<RequestServerVersion Version=\"Exchange2013\" "+
                    "xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\" soap:mustUnderstand=\"0\" />"+
                "</soap:Header>"+
                "<soap:Body>"+
                    "<m:GetItem Traversal=\"Shallow\">"+
                        "<m:ItemShape>"+
                            "<t:BaseShape>IdOnly</t:BaseShape>"+
                            "<t:AdditionalProperties>"+
                                "<t:FieldURI FieldURI=\"item:Subject\"></t:FieldURI>"+
                                // "<t:FieldURI FieldURI=\"item:Body\"></t:FieldURI>"+
                                "<t:FieldURI FieldURI=\"item:TextBody\"></t:FieldURI>"+
                            "</t:AdditionalProperties>"+
                        "</m:ItemShape>"+
                        "<m:ItemIds>"+
                            "<t:ItemId Id=\""+itemId+"\" ChangeKey=\""+changeKey+"\"></t:ItemId>"+
                        "</m:ItemIds>"+
                    "</m:GetItem>"+
                "</soap:Body>"+
            "</soap:Envelope>";
    }