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
- Windows 10 (development mode enabled)
- Either a Microsoft or Office 365 for business account.
Register the app
Navigate to the the Azure portal to register your app. Login using a personal account (aka: Microsoft Account) or Work or School Account.
Select New registration. On the Register an application page, set the values as follows.
- Set Name to
- Set Supported account types to Accounts in any organizational directory and personal Microsoft accounts.
- Leave Redirect URI empty.
- Choose Register.
- Set Name to
On the MeetingBot-Sample page, copy the value of the Application (client) ID. You will need it later.
Select the Add a Redirect URI link. On the Redirect URIs page, locate the Suggested Redirect URIs for public clients (mobile, desktop) section. Select the URI that begins with
msaland the urn:ietf:wg:oauth:2.0:oob URI.
Choose Save at the top of the page.
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.