Reputation: 526
We develop an Outlook Add-In using the office JavaScript api and need to Update a category for a mail message.
When trying to call UpdateItem with Exchange EWS, using the add-in token - it fails with 500.
See request and response at: http://pastebin.com/55x2d2Ht
Upvotes: 2
Views: 1315
Reputation: 119
You should be able to use UpdateItem with makeEwsRequestAsync
. You cannot use getCallbackTokenAsync
because this call returns a token that is read only that can only be used for GetItem
and GetAttachment
. When making a request with makeEwsRequestAsync
, your XML SOAP request (the data parameter in makeEwsRequest
should look like this:
<?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:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AutoResolve" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ItemChanges>
<t:ItemChange>
<t:ItemId Id = "AAMkAGI3NDEzZjRhLWU3ZjktNGViNy04MTI1LWFhOWRiZDRlY2QwNABGAAAAAADBaXFYA4KPQqsQBpmZF2+2BwAa6KJzOcvaRKcc5UfLbF5tAAAA4fK1AAACk4HLLuxASqDPNieBkIv8AANIKlICAAA=" ChangeKey="CQAAABYAAAACk4HLLuxASqDPNieBkIv8AANIb3mG"/>
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI = "item:Categories" />
<t:Message>
<t:Categories>
<t:String>Workout</t:String>
</t:Categories>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</ItemChanges>
</UpdateItem>
</soap:Body>
</soap:Envelope>
You should not need to pass in a callback token in order call makeEwsRequestAsync.
Upvotes: 2