Mailbox.makeEwsRequestAsync method (JavaScript API for Office v1.1)

JavaScript API for Office v1.1

Makes an asynchronous request to an Exchange Web Services (EWS) service on the Exchange server that hosts the user’s mailbox.

Last modified: June 12, 2014

Applicable Outlook modes

Compose or read

Available in requirement sets

Mailbox

Office.context.mailbox.makeEwsRequestAsync(data, callback, userContext);

data

The EWS request. Required.

callback

The method to call when the asynchronous load operation is complete. Required.

userContext

Any state data that is passed to the asynchronous method. Optional.

The makeEwsRequestAsync method sends an EWS request to Exchange Online, Exchange Online as part of Office 365, or a version of Exchange starting with Exchange 2013 that hosts the user’s mailbox. When the request is complete, the method specified by the callback parameter is called with one parameter, the result object. The result object has two properties: the context property contains the data in the userContext parameter, and the value property contains the XML result of the EWS request. If the result exceeds 1 MB in size, an error message is returned instead.

You cannot request Folder Associated Items with the makeEwsRequestAsync method.

The XML request must specify UTF-8 encoding.

<?xml version="1.0" encoding="utf-8"?>"

Your mail app must have the ReadWriteMailbox permission to use the makeEwsRequestAsync method. For information about using the ReadWriteMailbox permission and the EWS operations that you can call with the makeEwsRequestAsync method, see Specify permissions for mail app access to the user's mailbox.

NoteNote

The server administrator must set "OAuthAuthentication" to true on the Client Access Server EWS directory to enable the makeEwsRequestAsync method to make EWS requests.

Version differences

When you use the makeEwsRequestAsync method in mail apps running in Outlook versions earlier than version 15.0.4535.1004, you should set the encoding value to ISO-8859-1.

<?xml version="1.0" encoding="iso-8859-1"?>"

You do not need to set the encoding value when your mail app is running in Outlook Web App. You can determine whether your mail app is running in Outlook or Outlook Web App by using the mailbox.diagnostics.hostName property. You can determine what version of Outlook is running by using the mailbox.diagnostics.hostVersion property.

App types

Mail app

Supported clients

Outlook 2013, Outlook 2013 SP1, Outlook 2013 RT, Outlook Web App, and OWA for Devices

Library

Office.js

Namespace

Office

Show:
© 2014 Microsoft