列出日历
命名空间:microsoft.graph
获取用户的所有日历(/calendars 导航属性),从默认日历组或特定日历组中获取日历。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 | 权限(从最低特权到最高特权) |
|---|---|
| 委派(工作或学校帐户) | Calendars.Read, Calendars.Read.Shared, Calendars.ReadWrite |
| 委派(个人 Microsoft 帐户) | Calendars.Read, Calendars.Read.Shared, Calendars.ReadWrite |
| Application | Calendars.Read, Calendars.Read.Shared, Calendars.ReadWrite |
HTTP 请求
用户的所有日历。
GET /me/calendars
GET /users/{id | userPrincipalName}/calendars
特定 calendarGroup 中的用户日历。
GET /me/calendarGroups/{calendar_group_id}/calendars
GET /users/{id | userPrincipalName}/calendarGroups/{calendar_group_id}/calendars
可选的查询参数
此方法支持 OData 查询参数 来帮助自定义响应。
请求标头
| 标头 | 值 |
|---|---|
| Authorization | Bearer {token}。必需。 |
| Content-Type | application/json |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应正文中返回 200 OK 响应代码和 Calendar 对象集合。
示例
请求
请求示例如下所示。
GET https://graph.microsoft.com/v1.0/me/calendars
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#me/calendars",
"value": [
{
"@odata.id": "https://graph.microsoft.com/v1.0/users('ddfcd489-628b-40d7-b48b-57002df800e5@1717622f-1d94-4d0c-9d74-709fad664b77')/calendars('AAMkAGI2TGuLAAA=')",
"id": "AAMkAGI2TGuLAAA=",
"name": "Calendar",
"color": "auto",
"changeKey": "nfZyf7VcrEKLNoU37KWlkQAAA0x0+w==",
"canShare":true,
"canViewPrivateItems":true,
"hexColor": "",
"canEdit":true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": true,
"isRemovable": false,
"owner":{
"name":"Samantha Booth",
"address":"samanthab@adatum.onmicrosoft.com"
}
}
]
}
反馈
提交和查看相关反馈