Pieter van der Westhuizen

Office 365 – Exchange Online Extensibility. What is it and what can you use it for?

I hope by this time you have signed up for and are using Office 365. From what I’ve gathered from various sources on the internet and even our local radio stations it looks like Office 365 is starting to take the world by storm.

One of the features included in the Office 365 product offering is Exchange Online. What this means is that small companies can start benefiting from the type of enterprise software that traditionally only larger organisations could afford. The good news for us as developers is that this dramatically increases our target market and I’m sure you’re already wondering how to integrate with Exchange Online.

Since Exchange Online is essentially Microsoft Exchange for the Cloud, you’ll get all the rich benefits that you are used to from the on-premise edition. Clients will still be able to use the desktop version of Microsoft Outlook that is connected to Exchange Online as well as a web-based version of Outlook or rather the Outlook Web App.

I did get very excited when I saw the following on Microsoft MSDN about being able to customize the Outlook Web App:

“You can more closely integrate custom applications by using two Outlook Web App user interface modifications in Exchange 2010.

To link to external applications or enable users to create new items of a custom content class from Outlook Web App, you can register new entries to the New drop-down menu. You can also add entries to the right-click (context) menu.

To enable access to Web-based applications from the Outlook Web App user interface, you can add entries to the navigation pane. This is useful when you want to provide access within Outlook Web App to applications that are loosely integrated with Exchange; for example, expense-tracking applications that store data outside the Exchange store.”

Source: MSDN

Unfortunately this is only valid for an on-premise installation of Microsoft Exchange and not Exchange Online. The only UI customization available for Exchange Online is changing the theme. I’m sure in future this will be possible but for now we would have to live with it.

However, Microsoft Exchange Online does provide an integration point for developers via the Exchange Web services Managed API. The EWS API is a managed API to help you develop applications that use Exchange Web Services. The EWS API is a wrapper around the EWS proxy classes that makes it much easier than working directly with the Exchange web services. Best of all not only does it work with on-premise installations of Exchange but it is also compatible with the Cloud.

What can I do with the Exchange Web Services API?

If you’ve ever developed solutions for the on-premise version of Microsoft Exchange or wrote add-ins for Microsoft Outlook you will feel fairly comfortable with the EWS API. It provides you with create, read, update and delete access to the following mailbox items:

  • E-mail
  • Contacts
  • Tasks
  • Appointments
  • Public Folders and
  • Attachments

For example, if I write any .Net application I can reference the Microsoft Exchange Web services API assembly in my project and write the following code to send an e-mail from Exchange Online:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.Credentials = new WebCredentials("youremail@yourdomain.onmicrosoft.com", 
	"SuperSecretPassword");
service.AutodiscoverUrl("youremail@yourdomain.onmicrosoft.com");
 
EmailMessage email = new EmailMessage(service);
email.Subject = "Hey look! We're sendig via EWS!";
email.Body = new MessageBody("This has been sent using Exchange Web services, cool!");
 
email.ToRecipients.Add("D.K Schrute", "dk.schrute@d-m.com");
email.SendAndSaveCopy();

You can also create new Contacts, Tasks, Notes, Posts and Appointments (recurring or non-recurring). Functionality is not only limited to Exchange items, EWS enables you to leverage the Exchanges business logic by being able to Free/Busy status, receive notifications and synchronise items and folders.

Developers will also be able to add extended properties (Custom properties in Outlook terms) to Exchange items and folders as well as being able to perform searches on these properties as well as the standard Exchange item and folder properties.

I hope this article has shed some light on what can be expected by developers from Office 365′ Exchange Online offering and how we can interact with Exchange Online data and leverage its business logic for our applications.

To read more about the Microsoft Exchange Web Services I recommend the following resources:

Thank you for reading. Until next time, keep coding!

You may also be interested in:

2 Comments

  • GV says:

    Hello,

    First of all congratulations for the great job in this blog.
    Hi would like to have a little help from you.
    I need to have a search mechanism to find Contacts in an Exchange account using the EWS.
    The problem is that the Contacts are inside a Shared Contacts where that contacts come from the AD of my company.
    Hope you can help me.

    Kind Regards,
    V

  • Pieter van der Westhuizen says:

    Hi GV,

    Thank you for reading!
    Mmmm…this is not something I’ve yet had the need for, so I did some digging.
    Have a look at this link. They describe how you can access shared contacts using EWS.

    I have not tried it myself, but it looks like it might do the trick. Let us know how you progress, please.

    Good luck!

Post a comment

Have any questions? Ask us right now!