An example on how to interacte with Graph API from a bot
Explore the docs »
Report Bug
Request Feature
This is demo project that I use for live session or live on Twitch when I explain how the Microsoft Graph API works and how can we integrate them with ASP.NET Core. After some experiments this project became a real product. I pushed the source code on Github for this lite version. This is a kind of starter kit you can use to start your project and add the features you need. It's very simple and below you can find some useful information that helps you to understand the flow of the Azure AD authentication and how to retrieve a token to call the Microsoft Graph API.
This project is written with Visual Studio Code, ASP.NET Core, C#, Microsoft Bot Framework and Graph API.
Download or fork the project from this repository and open it in Visual Studio 2019 or Visual Studio Code. Restore all packages from Nuget and press F5 to start Debug. Launch the Bot Framework emulator and insert the correct endpoint for your Bot.
By default this project uses an application registered on our Azure AD tenant. You can use that for your test, but if you want to use this project for your own product, you have to create a new application on your tenant. Follow these steps:
- Login to portal.azure.com
- Enter in the section "Azure Active Directory"
- Click on "App Registrations"
- Create a new application
- In the "API permissions" section, click on "Add permission" and select Graph API
- Select the permission "Group.ReadWrite.All, Directory.ReadWrite.All"
- Grant the permissions in the previous screen
- From the main section "App Registrations", select "Authentication" and enable the checkbox "ID Tokens"
- Copy all entries in the "appsettings.json" from the project and paste them in the "Redirect URIs" section
You can publish the application on Azure or on your favorite cloud platform. The requirements are:
- HTTPS
- .NET Core 2.2 Runtime
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Emanuele Bartolesi - @kasuken - eba@expertsinside.com
Project Link: https://github.com/expertsinside/botty-mcbotface