How to hit the Microsoft Graph API

Microsoft Graph at https://graph.microsoft.com/v1.0 is one API over Microsoft 365: users, Outlook mail and calendar, OneDrive, Teams.

Authentication

Graph uses OAuth access tokens from Microsoft Entra ID. For quick testing, Graph Explorer shows a token under Access token. Send it as Authorization: Bearer <token>. In the examples it's written {{GRAPH_TOKEN}}.

Full reference: https://learn.microsoft.com/en-us/graph/overview

Signed-in user

curl https://graph.microsoft.com/v1.0/me \
  -H "Authorization: Bearer {{GRAPH_TOKEN}}"
Run in PostTaco

Recent emails

$select and $top are OData query options.

curl "https://graph.microsoft.com/v1.0/me/messages?$select=subject,from,receivedDateTime&$top=5" \
  -H "Authorization: Bearer {{GRAPH_TOKEN}}"
Run in PostTaco

Calendar events

curl "https://graph.microsoft.com/v1.0/me/events?$select=subject,start,end&$top=5" \
  -H "Authorization: Bearer {{GRAPH_TOKEN}}"
Run in PostTaco