by batman Fri Aug 16, 2019 3:51 pm
If you have the item id and change key for the message you can use the UpdateItem call and set the Message -> isRead property to true - see below for the SOAP syntax and fill in the itemID/ChangeKey when building the expression
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1" />
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId
Id="" ChangeKey="" />
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="message:IsRead" />
<t:Message>
<t:IsRead>true</t:IsRead>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>
Example expression to build the SOAP request (includes two variables ItemID and ChangeKey which contain the references to the original message.
>><?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP1" />
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="<< + InboundEmail.ItemID + >>" ChangeKey="<< + InboundEmail.MessageChangeKey + >>" />
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="message:IsRead" />
<t:Message>
<t:IsRead>true</t:IsRead>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope><<
Also check out
https://smarthub.kofax.com/ there's a few snippets and example robot on here for EWS integration that includes ingesting, sending and changing the read status of a message