You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过Microsoft Graph API提取Shifts请假请求中的用户备注?

解决Shifts请假请求备注的API获取问题

你调用/schedule/shifts端点是找错地方了——Shifts里的请假请求对应的是Graph API中的timeOff资源,不是shift资源,所以从shifts接口里拿不到备注信息。

正确的处理方式:

  • 使用/teams/{team-id}/schedule/timeOffs端点来获取请假请求数据,用户提交的备注对应返回对象里的notes字段。
  • 需要的权限:至少要有Schedule.Read.All(只读)或者Schedule.ReadWrite.All(读写)权限,确保已完成授权。

示例请求:

GET https://graph.microsoft.com/v1.0/teams/{team-id}/schedule/timeOffs?$filter=userId eq '{user-id}'

返回的timeOff对象结构里,notes字段就是你要找的请假备注内容:

{
  "id": "timeOff-id",
  "userId": "user-id",
  "createdDateTime": "2024-05-20T10:00:00Z",
  "lastModifiedDateTime": "2024-05-20T10:05:00Z",
  "notes": "家里有事需要请假一天",
  // 其他字段...
}

如果需要筛选特定时间段的请假请求,可以追加$filter条件,比如结合startDateTime和endDateTime缩小范围。

内容的提问来源于stack exchange,提问作者holyshilo111

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 16:03:08