by

How you can LikeUnlike an Merchandise utilizing EWS in Trade On-line

How you can LikeUnlike an Merchandise utilizing EWS in Trade On-line Likes and Mentions are a brand new function in Trade On-line (in OWA) that was launched late final 12 months in First Launch for Workplace365. With the targeted Inbox now being rolled out to interchange litter these are a number of the new social consumer curation kind options that might change the consumer expertise (hopefully for the higher) within the coming years. Whereas none of those options are new to these individuals utilizing different Social platforms like fb, twitter and many others they do supply a world of recent prospects to people who have just a little creativeness.

On this submit I am going to take a look at how one can Like an merchandise utilizing Trade Internet Providers eg

At present there is no such thing as a actual documentation on the usage of Likes in any API or how they’re delivered in Trade On-line so care ought to be taken as this could imply the function is topic to vary in any of the longer term service updates.

Versioning your Requests

To make use of likes absolutely you could be sure you model your EWS requests (which includes setting the ServerRequestVersion within the SOAP header) to V2015_10_05 or increased.  The Like info is returned by Trade as a Strongly Sort property in EWS (LikeType). Should you take a look at a Response that features the Like info within the SOAP response it is best to see each Like and LikePreview returned eg

<t:Likes>
<t:Like>
<t:Id>150bb06c-1c9a-4ac2-8b55-8cf15854b555</t:Id>
<t:CreatedBy>
<t:Identify>Glen Scales</t:Identify>
<t:EmailAddress>gscales@datarumble.com</t:EmailAddress>
<t:ExternalObjectId>150bb06c-1c9a-4ac2-8b55-8cf15854b555</t:ExternalObjectId>
</t:CreatedBy>
<t:CreatedDateTime>2016-08-28T10:26:40.299Z</t:CreatedDateTime>
<t:ServerCreatedDateTime>2016-08-28T10:26:40.299Z</t:ServerCreatedDateTime>
</t:Like>
</t:Likes>
<t:LikesPreview>
<t:LikeCount>1</t:LikeCount>
<t:IsLiked>true</t:IsLiked>
<t:Likers>
<t:Identify>Glen Scales</t:Identify>
<t:EmailAddress>gscales@datarumble.com</t:EmailAddress>
<t:RoutingType>SMTP</t:RoutingType>
<t:MailboxType>Mailbox</t:MailboxType>
<t:ExternalObjectId>150bb06c-1c9a-4ac2-8b55-8cf15854b555</t:ExternalObjectId>
</t:Likers>
</t:LikesPreview>
<t:AtAllMention>false</t:AtAllMention>

When you’ve got the most recent proxy objects from the Trade On-line WSDL then it is best to see the Likes and LikePreview property collections in the ItemType Class. Within the newest EWS Managed API from github https://github.com/OfficeDev/ews-managed-api solely the Likes class is presently out there.

Liking an Merchandise (Unsupported)

The EWS LikeItem operation presently has no definition within the Providers.WSDL so liking an Merchandise through EWS is presently unsupported. Nonetheless you may nonetheless use the operation so long as you assemble the request utilizing Uncooked SOAP message eg a request to like or in contrast to and merchandise utilizing EWS seem like

<?xml model="1.0" encoding="utf-8"?>
<cleaning soap:Envelope xmlns:cleaning soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<cleaning soap:Header>
<t:RequestServerVersion Model="V2015_10_05"/>
</cleaning soap:Header>
<cleaning soap:Physique xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<LikeItem>
<ItemId Id="AAM.." ChangeKey="CQA.."/>
<IsUnlike>false</IsUnlike>
</LikeItem>
</cleaning soap:Physique>
</cleaning soap:Envelope>

As that is an unsupported operation if you happen to do one thing like attempt to like the identical merchandise twice you’ll get a 500 error somewhat then a pleasant SOAP based mostly error response. I’ve put collectively a scrip that means that you can seek for an Merchandise through topic and like or in contrast to it utilizing EWS. I’ve put this up on GitHub right here https://github.com/gscales/Powershell-Scripts/blob/grasp/EWSLIkeMessage.ps1