问题描述
我已订阅 Microsoft 365 Business Basic 并尝试使用此帐户使用 Microsoft Graph API。
那我做了什么:
- 转到https://portal.azure.com/
- 在应用注册中创建一个新应用
- 为支持的帐户类型选择“任何组织目录中的帐户(任何 Azure AD 目录 - 多租户)和个人 Microsoft 帐户(例如 Skype、XBox)”。
- 创建应用后,在证书和机密中,我创建了一个新的客户端机密(选择永不过期)
- 然后在应用权限中,我添加了 Calendars.Read、Calendars.ReadWrite、User.Read.All、OnlineMeetings.Read.All、OnlineMeetings.ReadWrite.All 并授予所有管理员同意
然后测试创建事件 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>"
curl "https://graph.microsoft.com/v1.0/users" \
-H 'Authorization: Bearer <access token>' \
-H 'Content-Type: application/json; charset=utf-8'
然后,创建事件;
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": "[email protected]","name": "Teacher"
}
},{
"type": "required","emailAddress": {
"address": "[email protected]","name": "Parent"
}
},],"end": {
"dateTime": "2021-02-13T17:32:39.636Z","timeZone": "GMT+8"
},"start": {
"dateTime": "2021-02-11T16:32:39.636Z","subject": "My event","isOnlineMeeting": true,"body": {
"content": "Does this time work for you?","contentType": "HTML"
},"onlineMeetingProvider": "teamsForBusiness","allowNewTimeProposals": false
}'
我得到的回应似乎很好(我得到了我请求的所有信息以及一些其他数据)。我什至得到了我测试过的 joinUrl(我可以使用链接进入会议)。
唯一的问题是,与会者没有收到任何电子邮件通知。不知道是不是我订阅的计划是原因?
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)