MS Graph is a secured, unified API to connect to data located in various Microsoft 365 services.
- Just one API for different services
- Main focus on developers
- MS Graph REST API
- Powershell implementation exists
⚠️ It is NOT GraphQL or a graph based database!
Access to Azure / Active Directory / O365 / ...
-
Users and groups
-
Teams data
-
Tasks
-
Files
-
Mail
-
Meetings and calendars
-
Organizational charts
Image Source: https://learn.microsoft.com
- Centered on
- Users
- Groups
- Support scenarios related to
- identity
- security
- productivity
- collaboration
- ...
Example - User Profile Call:
GET /users/<name>@<tenant>.onmicrosoft.com
This will return a JSON Representation of the user profile.
- For different programming languages, like
- C#
- Java
- Java Script / Type Script / Node.js
- PowerShell
- ...
- web application
- free, open-source tool
- allows Graph REST API requests
- for testing, prototyping
-
Visit Graph Explorer and try some queries with the demo account.
-
Log in with your developer account.
- you should have setup an demo tenant
(E5 Subscription) in you ms dev account - use your Microsoft 365 developer tenant
- login with your admin user
- set consents for app
- you should have setup an demo tenant
-
Try "GET my profile" Sample Query
- request:
- try out the different tabs - especially
Modify Permissions
- atm we just have
User.Read
Permission - we only can view our own profile
- try out the different tabs - especially
- response:
- JSON with name / job / mail / id / ...
- try out the different tabs
- request:
-
Try "GET my mails" Sample Query
- response gives access denied
- switch to:
Request -> Modify Permissions
- Click on
Mail.Read
Consent - try query again - now you should see your mail(s) as JSON
-
Now it is time to solve your FIRST ASSIGNMENT 😱
Find a channel in one of the teams you are member of, and write "HELLO WORLD!" (or any other text) into that channel.
- TIP - Have a look at the MS Teams Sample Queries
- use them to find out your teams and channels
- add some Consents
- use a POST-query to write data
- TIP - Have a look at the MS Teams Sample Queries
-
Have a look at MS Teams (dev account), and find out if your message arrived
-
Be proud of yourself! 🎉
You want to write code for your app?
Not just some tryouts in a browser?
Fear not! The solution is already there!
- Have a look at the "Code Snippets"-Tab within the response field
- You will find code for C# / JavaScript / Java / Go / Powershell
- Don't forget to copy the "Access Token" (see according tab in request field)
- The programming languages authentication steps vary!
- Use at your own risk!