0

I used Windows 10 email app to connect to my exchange server, i.e. I have instance of UserDataAccount for my exchange server already set up.

I want to write another app that will use this account to talk to Exchange, and I would like to use only WinRT API.

First I need to get Exchange info from UserDataAccount. if it's hosted in cloud, I think I will need URL, tenant ID and username. The problem is that UserDataAccount does not have this info. There is class DeviceAccountConfiguration that seems to have it all, but I cannot find a way to get instance of this class.

Once I can get info about Exchange connection, I can use Office356 REST to talk to Exchange. The reason I want to talk to Exchange directly is because I did not find WinRT API that can use UserDataAccount to retrieve Exchange specific info, for example full info from Exchange about Contact.

So I have UserDataAcccount, and from this data account I need to get credentials and info about Exchange API (EWS, or REST). After that it should be easy, see Adam's answer with link to office356 sample code.

I spent some time poking around WinRT API, but it's poorely documented, and it's hard to discover relationships between different objects, and some methods throw NotImplemented exceptions.

Is WintRT API ready to be used? It looks like a lot of things are disconnected and missing.

Please help!

Thank you

Dima
  • 699
  • 1
  • 6
  • 18

1 Answers1

1

We have sample code for WinRT to access contact. See: https://github.com/OfficeDev/O365-Windows-Start

**Contacts**
Get contacts
Create contacts
Update contacts
Delete contacts
Change contact photo

Also we have just plain REST api examples including calling into a test sandbox at https://dev.outlook.com/RestGettingStarted

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71
  • Hi, Adam, thank you for the info, it does help with the second part of my question. However, before I get to REST and Office365 specifics, I need to find out that I am actually dealing with Office356. The sample code does not answer this question. It does not use Windows.ApplicationModel.UserDataAccounts, and this is what "wraps" office365 in my case. Also, while your sample app does run as universal win app, if uses mix of WinRT and .NET classes. I am trying to use only WinRT. The still missing link for me is: how can I get office365 settings having UserDataAccount and using only WinRT? – Dima Dec 07 '15 at 18:25
  • I'm not sure what you mean when you want to use only WinRT - if it runs under WinRT it is running as WinRT, otherwise the api isn't available (hence why you couldn't use Hashtable for example) what specifically were you referring to? – Adam Tuliper Dec 14 '15 at 07:32
  • WinRT is a COM based API, it does not require .NET runtime, I can use this API it from plain C++. In this case .NET class Hashtable is not available as it's not part of WinRT. See Windows.Foundation.Collections namespace. Most real world apps use more than one API: especially if app is written in C++. It would use some STL, some ATL, some WinRT, and some Win32. The problem is how do you pass data from one API to another. – Dima Dec 15 '15 at 10:49