Closed edwinlimlx closed 7 years ago
Hi,
I've tried many examples with structuring the JSON request for different services and it works great. However I encounter an interesting on in CreateItem for Email.
https://msdn.microsoft.com/en-us/library/office/aa566468#sectionSection0 This is one special case where I need to enter attribute and text/value into the "Body" field. How do I structure that in the JSON format?
tried doing the below, but it return "The request failed schema validation: The element 'http://schemas.microsoft.com/exchange/services/2006/types:Body' cannot contain child element 'http://schemas.microsoft.com/exchange/services/2006/types:text' because the parent element's content model is text only."
"Body": { "attributes": { "BodyType": "HTML" }, "text": "test" }
The Full ewsArgs. let ewsArgs = { "attributes": { "MessageDisposition": "SendAndSaveCopy" }, "SavedItemFolderId": { "DistinguishedFolderId": { "attributes": { "Id": "sentitems" } } }, "Items": { "Message": { "Subject": "Test Subject", "Body": { "attributes": { "BodyType": "HTML" } }, "ToRecipients": { "Mailbox": { "EmailAddress": "test@test.com" } } } } };
let ewsArgs = { "attributes": { "MessageDisposition": "SendAndSaveCopy" }, "SavedItemFolderId": { "DistinguishedFolderId": { "attributes": { "Id": "sentitems" } } }, "Items": { "Message": { "Subject": "Test Subject", "Body": { "attributes": { "BodyType": "HTML" } }, "ToRecipients": { "Mailbox": { "EmailAddress": "test@test.com" } } } } };
my bad, found the answer, "$value"
Yep! Glad you figured it out.
Hi,
I've tried many examples with structuring the JSON request for different services and it works great. However I encounter an interesting on in CreateItem for Email.
https://msdn.microsoft.com/en-us/library/office/aa566468#sectionSection0 This is one special case where I need to enter attribute and text/value into the "Body" field. How do I structure that in the JSON format?
tried doing the below, but it return "The request failed schema validation: The element 'http://schemas.microsoft.com/exchange/services/2006/types:Body' cannot contain child element 'http://schemas.microsoft.com/exchange/services/2006/types:text' because the parent element's content model is text only."
"Body": { "attributes": { "BodyType": "HTML" }, "text": "test" }
The Full ewsArgs.
let ewsArgs = { "attributes": { "MessageDisposition": "SendAndSaveCopy" }, "SavedItemFolderId": { "DistinguishedFolderId": { "attributes": { "Id": "sentitems" } } }, "Items": { "Message": { "Subject": "Test Subject", "Body": { "attributes": { "BodyType": "HTML" } }, "ToRecipients": { "Mailbox": { "EmailAddress": "test@test.com" } } } } };