I create a logical search folder to contain all the emails with a specific category. I then pull those emails using FindItem+ParentFolderIds query. The speed of this FindItem query seems to be proportional to the total number of emails in the account and not how many emails in the logical search folder. Is this normal behavior?
Here is the query to create the search folder:
<?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" />
</soap:Header>
<soap:Body>
<m:CreateFolder>
<m:ParentFolderId>
<t:DistinguishedFolderId Id="searchfolders" />
</m:ParentFolderId>
<m:Folders>
<t:SearchFolder>
<t:DisplayName>MySearchFolder</t:DisplayName>
<t:PermissionSet>
<t:Permissions />
</t:PermissionSet>
<t:SearchParameters Traversal="Deep">
<t:Restriction>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="My_Category" />
</t:Contains>
</t:Restriction>
<t:BaseFolderIds>
<t:DistinguishedFolderId Id="root" />
</t:BaseFolderIds>
</t:SearchParameters>
</t:SearchFolder>
</m:Folders>
</m:CreateFolder>
</soap:Body>
</soap:Envelope>
And here's the query to retrieve the emails from the search folder:
<?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="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:IsEqualTo>
<t:FieldURI FieldURI="item:IsDraft" />
<t:FieldURIOrConstant>
<t:Constant Value="false" />
</t:FieldURIOrConstant>
</t:IsEqualTo>
</m:Restriction>
<m:ParentFolderIds>
<t:FolderId Id="<The_SEARCH_FOLDER_ID>" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
Keep in mind that items aren't actually "in" a search folder. A search folder is really just a persistent search result that you can treat like a folder. So those items are still all spread out across different folders in the mailbox.
When you query the search folder you're adding a second restriction (IsDraft = false) which is likely causing the results to be reevaluated.
Related
My ariba network cannot parse my document cXML response. At ariba screen i have this response
<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1501467044460-2947794417638298020#216.109.111.19" timeStamp="2017-07-30T19:10:44-07:00">
<Response>
<Status code="200" text="OK" />
<PunchOutSetupResponse>
<StartPage>
<URL>test.ariba.com</URL>
</StartPage>
</PunchOutSetupResponse>
</Response>
</cXML>
However I still get this message from Ariba:
Couldn't parse document
Can anyone support me with this.
This is the document we're using and working correctly
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML timestamp="<%= #timestamp %>" payloadID="<%= #payload_id %>">
<Response>
<Status code="200" text="success"></Status>
<PunchOutSetupResponse>
<StartPage>
<URL><%= #start_url %></URL>
</StartPage>
</PunchOutSetupResponse>
</Response>
</cXML>
The start_url must be a valid URL like http://test.mysite.com/xxxxx
could you check if there is language dependency. lang="en-US"
My outlook addin uses "ReadWriteMailbox" permission. I am trying to use makeEwsRequestAsync method and send a EWS "MoveItem" request to move the message to a specific folder. But i am getting the following errror,
"The EWS Id is in EwsLegacyId format which is not supported by the Exchange version specified by your request. Please use the ConvertId method to convert the Id from EwsId to EwsLegacyId format."
Request Sent
<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:Header>
<RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body>
<MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ToFolderId>
<t:FolderId Id="AAAbAEJhbGFrcmlzaG5hbl9SQHN5bWFudGVjLmNvbQAuAAAAAACALDzcpfeRQ7ZlsoKB0iVmAQAjK9sGaxZsQpt2dmaMGjhaAADb64+wAAA=" ChangeKey="AQAAABYAAAAjK9sGaxZsQpt2dmaMGjhaAADcIrnw"/>
</ToFolderId>
<ItemIds>
<t:ItemId Id="AAMkAGJiNjY2ZTk1LTZkMDEtNGQyYy05M2M2LWMyZmQwMzY1M2JhMQBGAAAAAACALDzcpfeRQ7ZlsoKB0iVmBwArZr3QPuquTIplat84SmYEAEq/mAl5AAAjK9sGaxZsQpt2dmaMGjhaAADb62uqAAA="/>
</ItemIds>
</MoveItem>
</soap:Body>
</soap:Envelope>
Response Received
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1075" MinorBuildNumber="20" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:MoveItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:MoveItemResponseMessage ResponseClass="Error">
<m:MessageText>The EWS Id is in EwsLegacyId format which is not supported by the Exchange version specified by your request. Please use the ConvertId method to convert the Id from EwsId to EwsLegacyId format.
</m:MessageText>
<m:ResponseCode>ErrorInvalidIdMalformed</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items/>
</m:MoveItemResponseMessage>
</m:ResponseMessages>
</m:MoveItemResponse>
</s:Body>
</s:Envelope>
I am able to use the MoveItem EWS operation and move the messages to "Junk Email" folder. But i want to move messages to a specific folder created by a earlier "CreateFolder" EWS operation. The id of the folder is "AAAbAEJhbGFrcmlzaG5hbl9SQHN5bWFudGVjLmNvbQAuAAAAAACALDzcpfeRQ7ZlsoKB0iVmAQAjK9sGaxZsQpt2dmaMGjhaAADb64+wAAA="
Using the above id in "GetFolder" operation correctly returns the no. of items in the folder. But I am not able to get the "MoveItem" operation to work. All the EWS operations are performed via the "makeEwsRequestAsync" call. Could you help with this?
Updates
CreateFolder Request:
<?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:Header>
<RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body>
<CreateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ParentFolderId><t:DistinguishedFolderId Id="msgfolderroot"/></ParentFolderId> <Folders><t:Folder><t:DisplayName>Submissions</t:DisplayName></t:Folder></Folders>
</CreateFolder>
</soap:Body>
</soap:Envelope>
Create Folder Response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1075" MinorBuildNumber="21" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:CreateFolderResponse
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:CreateFolderResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Folders>
<t:Folder><t:FolderId Id="AAAbAEJhbGFrcmlzaG5hbl9SQHN5bWFudGVjLmNvbQAuAAAAAACALDzcpfeRQ7ZlsoKB0iVmAQAjK9sGaxZsQpt2dmaMGjhaAADek+aFAAA=" ChangeKey="AQAAABYAAAAjK9sGaxZsQpt2dmaMGjhaAADeyyJ9"/>
</t:Folder>
</m:Folders>
</m:CreateFolderResponseMessage>
</m:ResponseMessages>
</m:CreateFolderResponse>
</s:Body>
</s:Envelope>
Move Item Request:
<?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:Header> <RequestServerVersion Version="Exchange2013" /> </soap:Header>
<soap:Body>
<MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ToFolderId>
<t:FolderId Id="AAAbAEJhbGFrcmlzaG5hbl9SQHN5bWFudGVjLmNvbQAuAAAAAACALDzcpfeRQ7ZlsoKB0iVmAQAjK9sGaxZsQpt2dmaMGjhaAADek+aFAAA=" ChangeKey="AQAAABYAAAAjK9sGaxZsQpt2dmaMGjhaAADeyyJ9"/>
</ToFolderId>
<ItemIds>
<t:ItemId Id="AAMkAGJiNjY2ZTk1LTZkMDEtNGQyYy05M2M2LWMyZmQwMzY1M2JhMQBGAAAAAACALDzcpfeRQ7ZlsoKB0iVmBwArZr3QPuquTIplat84SmYEAEq/mAl5AAAjK9sGaxZsQpt2dmaMGjhaAADdyMHzAAA="/>
</ItemIds>
</MoveItem>
</soap:Body>
</soap:Envelope>
Move Item Response:
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1075" MinorBuildNumber="21" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:MoveItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:MoveItemResponseMessage ResponseClass="Error">
<m:MessageText>The EWS Id is in EwsLegacyId format which is not supported by the Exchange version specified by your request. Please use the ConvertId method to convert the Id from EwsId to EwsLegacyId format.
</m:MessageText>
<m:ResponseCode>ErrorInvalidIdMalformed</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items/>
</m:MoveItemResponseMessage>
</m:ResponseMessages>
</m:MoveItemResponse>
</s:Body>
</s:Envelope>
More likely your requests to "CreateFolder" and request "MoveItem" have different "RequestServerVersion". Read more on EWS schema versions in Exchange. EWS Id format has been changed I believe in "Exchange2007_SP1" version. This make me think you have used the example for "CreateFolder" request which include "RequestServerVersion" set to "Exchange2007" and it will return legacy folder Id.
EDIT:
I didn't try to reproduce your requests/response sequence, instead I used documented ways to send the following requests:
CreateFolder operation
MoveItem operation
Request to create the folder looks like ...
<?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>
<t:RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<CreateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ParentFolderId>
<t:DistinguishedFolderId Id="msgfolderroot"/>
</ParentFolderId>
<Folders>
<t:Folder>
<t:DisplayName>Test Folder1</t:DisplayName>
</t:Folder>
</Folders>
</CreateFolder>
</soap:Body>
</soap:Envelope>
And response is ...
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1084" MinorBuildNumber="21" Version="V2017_04_14" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body>
<m:CreateFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:CreateFolderResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Folders>
<t:Folder>
<t:FolderId Id="AQMkADg0ZDZhNWFiLWE0Y2EtNDc4My05MGU1LTY5ZWNiOTQ5MmY5YwAuAAADEgGHnGK1T06Yq8xwQCjiHwEAkUJPW0th2EGwjXYeK6AWSQABv62c1AAAAA==" ChangeKey="AQAAABYAAACRQk9bS2HYQbCNdh4roBZJAAG/8ffU"/>
</t:Folder>
</m:Folders>
</m:CreateFolderResponseMessage>
</m:ResponseMessages>
</m:CreateFolderResponse>
</s:Body>
</s:Envelope>
The folder created successfully. As per documentation to perform MoveItem request I need the item's change key. I performed GetItem request and got the following response ...
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1084" MinorBuildNumber="21" Version="V2017_04_14" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemId Id="AQMkADg0ZDZhNWFiLWE0Y2EtNDc4My05MGU1LTY5ZWNiOTQ5MmY5YwBGAAADEgGHnGK1T06Yq8xwQCjiHwcAkUJPW0th2EGwjXYeK6AWSQAAAgEMAAAAkUJPW0th2EGwjXYeK6AWSQABv62YlAAAAA==" ChangeKey="CQAAABYAAACRQk9bS2HYQbCNdh4roBZJAAG/8awE"/>
</t:Message>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</m:GetItemResponse>
</s:Body>
</s:Envelope>
And finally I need to move the item. The following is my request to move the item ....
<?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>
<t:RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<ToFolderId>
<t:FolderId Id="AQMkADg0ZDZhNWFiLWE0Y2EtNDc4My05MGU1LTY5ZWNiOTQ5MmY5YwAuAAADEgGHnGK1T06Yq8xwQCjiHwEAkUJPW0th2EGwjXYeK6AWSQABv62c1AAAAA=="/>
</ToFolderId>
<ItemIds>
<t:ItemId Id="AQMkADg0ZDZhNWFiLWE0Y2EtNDc4My05MGU1LTY5ZWNiOTQ5MmY5YwBGAAADEgGHnGK1T06Yq8xwQCjiHwcAkUJPW0th2EGwjXYeK6AWSQAAAgEMAAAAkUJPW0th2EGwjXYeK6AWSQABv62YlAAAAA==" ChangeKey="CQAAABYAAACRQk9bS2HYQbCNdh4roBZJAAG/8awE"/>
</ItemIds>
</MoveItem>
</soap:Body>
</soap:Envelope>
It is succeeded and item has been moved to my new folder.
The following are suggestions for you to proceed with your debugging ...
Look at the request how you get the itemId. The issue may be there. You need to specify the same "RequestServerVersion" to get the ChangeKey.
I suggest you to have common function for all SOAP request you do to wrap each request body. In this case you will not get in trouble with legacy data.
Something like this, very simple wrapper ...
/**
* Wrap an Exchange Web Services request in a SOAP envelope.
* #private
* #param {string} payload request XML.
* #return {string} Ready to send SOAP EWS request.
*/
function _wrapSoapEnvelope(payload) {
var result = '<?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>' +
'<t:RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />' +
'</soap:Header>' +
'<soap:Body>' + payload + '</soap:Body>' +
'</soap:Envelope>';
return result;
};
In this case your requests will be very simple and unified (the following 3 requests I have used for your case) ...
this.createFolderRequest = function (folderName) {
var result = '<CreateFolder xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">' +
'<ParentFolderId>' +
'<t:DistinguishedFolderId Id="msgfolderroot"/>' +
'</ParentFolderId>' +
'<Folders>' +
'<t:Folder>' +
'<t:DisplayName>' + folderName + '</t:DisplayName>' +
'</t:Folder>' +
'</Folders>' +
'</CreateFolder>';
return _wrapSoapEnvelope(result);
};
this.moveItemRequest = function (folderId, itemId, changeKey) {
var result = '<MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">' +
'<ToFolderId>' +
'<t:FolderId Id="' + folderId + '"/>' +
'</ToFolderId>' +
'<ItemIds>' +
'<t:ItemId Id="' + itemId + '" ChangeKey="' + changeKey + '"/>' +
'</ItemIds>' +
'</MoveItem>';
return _wrapSoapEnvelope(result);
};
this.getChangeKeyRequest = function (itemId) {
var result = '<GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">' +
'<ItemShape>' +
'<t:BaseShape>IdOnly</t:BaseShape>' +
'</ItemShape>' +
'<ItemIds><t:ItemId Id="' + itemId + '"/></ItemIds>' +
'</GetItem>';
return _wrapSoapEnvelope(result);
};
I suggest you check your requests as they are look different and follow Microsoft original documentation, instead of examples taken from other sources.
And this is it. The purpose of SO is QandA, not remote debugging, so you are on your own with your code issues. Please take a time to debug, clean up your code as well as read a bit more on documentation provided and you'll make it work.
I started developing add-in for OWA for Exchange 2013.
I have a couple of questions related to it.
I would be happy if someone could help me with them.
Is it possible to add button(via add-in commands in manifest) to the top pane in OWA?
http://screencast.com/t/CvOqOsnI
Is it possible to get the content of a message? Let's say byte array or base64 string... I've looked through the documentation and have found nothing about it.
Office.context.mailbox.item doesn't have method or property to get the content of the message.
Thank you in advance.
As I understand you want to put your extension together with "Move to" and "Categories". If that is what you want, I want to say that it is not possible.
Here I have workaround, you can send SOAP request to the Exchange API and get the mail content.
Add-in commands are currently only supported in Outlook 2013 and 2016. They will most likely be available in Outlook Online and Outlook.com at a future date.
If Outlook.context.mailbox.item.Body.getAsync is not sufficient and you need the full MIME content of the message, use mailbox.makeEWSRequestAsync with a GetItem call that includes the 7C08 extended property:
<!--Call:-->
<?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:Header>
<RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<GetItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ItemShape>
<t:BaseShape>Default</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:Body" />
<t:FieldURI FieldURI="item:Subject" />
<t:ExtendedFieldURI PropertyTag="7C08" PropertyType="Binary" />
</t:AdditionalProperties>
</ItemShape>
<ItemIds>
<t:ItemId Id="AAMkAGUzNmEzYTBmLTI1NDItNGE0My1iZDk5LWFkMDgxODI3YWNlOQBGAAAAAACK2VEhi72QSaw+u0XV7xUHBwCMotTyA3QkQ7TPAmcrRt4FAAAALwVMAAAuH/1UA8tzTYD5jbYriaIUAAAJ5576AAA=" />
</ItemIds>
</GetItem>
</soap:Body>
</soap:Envelope>
<!--Response:-->
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="396" MinorBuildNumber="20" Version="V2015_10_05" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:GetItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:MimeContent CharacterSet="UTF-8">U3ViamVjdDoNClRocmVhZC1JbmRleDogQVFIT3hWSjZLdTJONnltWUxVNlBtQWNpamJYaTdBPT0NCkRhdGU6IFRodSwgMTAgT2N0IDIwMTMgMDA6NDg6NDggKzAwMDANCk1lc3NhZ2UtSUQ6DQoJPGI3MDM3MWNkYjkyZTRhYjc4NzFlM2FjYjgzZjVmMmJlQEJOMVBSMDRNQjM1OC5uYW1wcmQwNC5wcm9kLm91dGxvb2suY29tPg0KQ29udGVudC1MYW5ndWFnZTogZW4tQ0ENClgtTVMtSGFzLUF0dGFjaDoNClgtTVMtVE5FRi1Db3JyZWxhdG9yOg0KQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PSJ1cy1hc2NpaSINCk1JTUUtVmVyc2lvbjogMS4wDQoNCg==</t:MimeContent>
<t:ItemId Id="AAMkAGUzNmEzYTBmLTI1NDItNGE0My1iZDk5LWFkMDgxODI3YWNlOQBGAAAAAACK2VEhi72QSaw+u0XV7xUHBwCMotTyA3QkQ7TPAmcrRt4FAAAALwVMAAAuH/1UA8tzTYD5jbYriaIUAAAJ5576AAA=" ChangeKey="CQAAABYAAAAuH/1UA8tzTYD5jbYriaIUAAAJ6HVa"/>
<t:Sensitivity>Normal</t:Sensitivity>
<t:Body BodyType="Text" IsTruncated="false"/>
<t:Size>1618</t:Size>
<t:DateTimeSent>2013-10-10T00:48:48Z</t:DateTimeSent>
<t:DateTimeCreated>2013-10-10T00:48:47Z</t:DateTimeCreated>
<t:ResponseObjects>
<t:ForwardItem/>
</t:ResponseObjects>
<t:HasAttachments>false</t:HasAttachments>
<t:IsAssociated>true</t:IsAssociated>
<t:IsReadReceiptRequested>false</t:IsReadReceiptRequested>
<t:IsRead>true</t:IsRead>
</t:Message>
</m:Items>
</m:GetItemResponseMessage>
</m:ResponseMessages>
</m:GetItemResponse>
</s:Body>
</s:Envelope>
For reason the two-line display of containers in browse are not working, via search it works perfectly. Can someone please review below output?
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getMetadataResponse xmlns="http://www.sonos.com/Services/1.1">
<getMetadataResult>
<index>0</index>
<count>2</count>
<total>2</total>
<mediaCollection>
<canPlay>true</canPlay>
<id>album-1200</id>
<title>En de wind stilde</title>
<itemType>album</itemType>
<artistId>artist-5716</artistId>
<artist>Ds. D.W. Tuinier</artist>
<albumArtURI>http://***/albumart.php?album_id=1200&size=200</albumArtURI>
</mediaCollection>
<mediaCollection>
<canPlay>true</canPlay>
<id>album-1163</id>
<title>De Tas</title>
<itemType>album</itemType>
<artistId>artist-5619</artistId>
<artist>Ben de Raaf</artist>
<albumArtURI>http://***/albumart.php?album_id=1163&size=200</albumArtURI>
</mediaCollection>
</getMetadataResult>
</getMetadataResponse>
</soap:Body>
</soap:Envelope>
The source of the problem was located in the parent container, the itemType of the parent container should be AlbumList instead of a container.
Many thanks Sonos Developer Advocacy.
I have been receiving the following error when trying to post updated login credentials:
<Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Can not invoke the getTypeObject method in the extension mapper class...
I am accessing the SOAP API via a rails app using the savon gem.
addItemForContentService is working with the same xsi:type definition, and I have used getLoginFormCredentialsForItem to retrieve FormInfos to push back into updateCredentialsForItem1, with no success.
If I could just get some sample xml (that works) for this call I would really appreciate it.
It seems like the parameters you are sending are incorrect or the WSDL format.
For your reference below is XML for updateCredentialsForItem1(you need to change values):
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateCredentialsForItem1 xmlns="http://itemmanagement.accountmanagement.core.soap.yodlee.com">
<userContext xmlns="">
<cobrandId>134131232</cobrandId>
<channelId>-1</channelId>
<locale>
<country>US</country>
<language>en</language>
<variant></variant>
</locale>
<tncVersion>2</tncVersion>
<applicationId>7A367HGJ621219F00</applicationId>
<cobrandConversationCredentials xsi:type="ns1:SessionCredentials" xmlns:ns1="http://login.ext.soap.yodlee.com">
<sessionToken>YOUR_COBRAND_CONVERSATION_TOKEN_VALUE</sessionToken>
</cobrandConversationCredentials>
<preferenceInfo>
<currencyCode>USD</currencyCode>
<timeZone>PST</timeZone>
<dateFormat>MM/dd/yyyy</dateFormat>
<currencyNotationType>SYMBOL_NOTATION</currencyNotationType>
<numberFormat>
<decimalSeparator>.</decimalSeparator>
<groupingSeparator>,</groupingSeparator>
<groupPattern>###,##0.##</groupPattern>
</numberFormat>
</preferenceInfo>
<fetchAllLocaleData>false</fetchAllLocaleData>
<conversationCredentials xsi:type="ns2:SessionCredentials" xmlns:ns2="http://login.ext.soap.yodlee.com">
<sessionToken>USER_CONVERSATION_TOKEN_VALUE</sessionToken>
</conversationCredentials>
<valid>true</valid>
<isPasswordExpired>false</isPasswordExpired>
</userContext>
<itemId xmlns="">1219123123</itemId>
<credentialFields xmlns="">
<elements xsi:type="ns3:SecureFieldInfoSingle" xmlns:ns3="http://common.soap.yodlee.com">
<name>LOGIN</name>
<displayName>Username</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>2212059</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_USERNAME</value>
<valueIdentifier>LOGIN</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>TEXT</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
<elements xsi:type="ns4:SecureFieldInfoSingle" xmlns:ns4="http://common.soap.yodlee.com">
<name>PASSWORD1</name>
<displayName>Password</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>22121258</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_PASSWORD_VALUE</value>
<valueIdentifier>PASSWORD1</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>PASSWORD</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
<elements xsi:type="ns5:FieldInfoSingle" xmlns:ns5="http://common.soap.yodlee.com">
<name></name>
<displayName>Verify Password</displayName>
<isEditable>true</isEditable>
<isOptional>false</isOptional>
<isEscaped>false</isEscaped>
<helpText>22121258</helpText>
<isOptionalMFA>false</isOptionalMFA>
<isMFA>false</isMFA>
<value>ACTUAL_PASSWORD_VALUE</value>
<valueIdentifier>PASSWORD1</valueIdentifier>
<valueMask>LOGIN_FIELD</valueMask>
<fieldType>PASSWORD</fieldType>
<size>20</size>
<maxlength>40</maxlength>
</elements>
</credentialFields>
<startRefreshItemOnUpdate xmlns="">false</startRefreshItemOnUpdate>
</updateCredentialsForItem1>
</soapenv:Body>
</soapenv:Envelope>