Microsoft Graph MeetingBot sample for UWP
Table of contents
- Register and configure the app
- Build and debug
- Running the sample
- Questions and comments
- Additional resources
This sample demonstrates how to integrate Microsoft Graph capabilities into a UWP app that uses Cortana voice commands. Once you've installed it and signed in, you can activate it by asking Cortana to show the next meeting on your calendar and/or asking Cortana to tell the participants of your next meeting that you're running late.
It uses the Microsoft Graph .NET Client Library to work with data returned by Microsoft Graph. The sample uses the v2.0 authentication endpoint, which enables users to sign in with either their personal or work or school Microsoft accounts.
This sample requires the following:
- Visual Studio 2015
- Windows 10 (development mode enabled)
- Either a Microsoft or Office 365 for business account.
Register and configure the app
- Sign into the App Registration Portal using either your personal or work or school account.
- Select Add an app.
Enter a name for the app, and select Create application.
The registration page displays, listing the properties of your app.
Under Platforms, select Add platform.
- Select Mobile platform.
Copy the Application Id to the clipboard. You'll need to enter this value into the sample app.
The app id is a unique identifier for your app. The redirect URI is a unique URI provided by Windows 10 for each application to ensure that messages sent to that URI are only sent to that application.
Build and debug
Note: If you see any errors while installing packages during step 2, make sure the local path where you placed the solution is not too long/deep. Moving the solution closer to the root of your drive resolves this issue.
After you've loaded the solution in Visual Studio, configure the sample to use the application id that you registered by adding the corresponding values for these keys in the Application.Resources node of the App.xaml file.
Press F5 to build and debug. Run the solution and sign in with either your personal or work or school account.
Running the sample
When you first run the sample, you'll be prompted to sign in with your Microsoft or Office 365 for business account. After you've authenticated and consented to the required permissions, you won't have to sign in again unless you want to run the sample with another account.
If you want to sign out and then sign in with a different account, select the disconnect button at the top right of the app and then select the connect button to its left.
After you've installed and run the app once, you can activate it at any time by issuing the following voice commands to Cortana:
- "MeetingBot, show my next meeting."
- "MeetingBot, tell my next meeting I'm going to be late."
If you've enabled the "Hey Cortana" feature, you can activate the app at any time by issuing these voice commands to your device:
- "Hey Cortana, ask MeetingBot to show my next meeting."
- "Hey Cortana, ask MeetingBot to tell my next meeting I'm going to be late."
In both cases, the app will launch and display the title and time frame of your next meeting. If you ask MeetingBot to tell your next meeting that you're going to be late, the app will either confirm that it has sent a "running late" message to your next meeting's participants, or it will tell you that it couldn't find the meeting invitation in your account's mailbox.
If you'd like to contribute to this sample, see CONTRIBUTING.MD.
Questions and comments
We'd love to get your feedback about the Microsoft Graph MeetingBot for UWP project. You can send your questions and suggestions to us in the Issues section of this repository.
Your feedback is important to us. Connect with us on Stack Overflow. Tag your questions with [MicrosoftGraph].
- Other Microsoft Graph UWP samples
- Microsoft Graph overview
- Office developer code samples
- Office dev center
Copyright (c) 2016 Microsoft. All rights reserved.