I've subscribed to Microsoft 365 Business Basic and to try using Microsoft Graph API using this account.
So what have I done:
- Go to https://portal.azure.com/
- Create a new app in App Registration
- Choose "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) "for supported account types.
- Once the app is created, in Certificates & Secrets, I created a new Client secret (chose never expires)
- Then in App Permissions, I've added Calendars.Read, Calendars.ReadWrite, User.Read.All, OnlineMeetings.Read.All, OnlineMeetings.ReadWrite.All and grant all of them Admin consent
Then to test the create event API.
curl -X "POST" "https://login.microsoftonline.com/<tenant ID>/oauth2/v2.0/token"
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'
--data-urlencode "scope=https://graph.microsoft.com/.default"
--data-urlencode "grant_type=client_credentials"
--data-urlencode "client_secret=<client secret>"
--data-urlencode "client_id=<app/client id>"
Then, get list of users, to get the user ID
curl "https://graph.microsoft.com/v1.0/users"
-H 'Authorization: Bearer <access token>'
-H 'Content-Type: application/json; charset=utf-8'
Then, create the event;
curl -X "POST" "https://graph.microsoft.com/v1.0/users/<user ID>/events"
-H 'Authorization: Bearer <access token>'
-H 'Content-Type: application/json'
-d $'{
"attendees": [
{
"type": "required",
"emailAddress": {
"address": "teacher@school.com",
"name": "Teacher"
}
},
{
"type": "required",
"emailAddress": {
"address": "parent@domain.com",
"name": "Parent"
}
},
],
"end": {
"dateTime": "2021-02-13T17:32:39.636Z",
"timeZone": "GMT+8"
},
"start": {
"dateTime": "2021-02-11T16:32:39.636Z",
"timeZone": "GMT+8"
},
"subject": "My event",
"isOnlineMeeting": true,
"body": {
"content": "Does this time work for you?",
"contentType": "HTML"
},
"onlineMeetingProvider": "teamsForBusiness",
"allowNewTimeProposals": false
}'
The response I get seems good (I get the back all the information that I requested along with some other data). I even get the joinUrl that I've tested fine (I can use the link to get into the meeting).
The only problem is that, the attendees didn't get any email notifications. I wonder if the plan I subscribed is the reason?
Thanks
question from:
https://stackoverflow.com/questions/65878975/attendees-didnt-get-any-email-notifications-on-calendar-event-creation 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…