Microsoft Graph API / me / people 403禁止的错误

问题描述 投票:0回答:1

我在尝试使用/ me / people获取Outlook上的联系人列表时收到403禁止错误。这适用于Graph Explore,但不适用于我的应用程序。

try {
  const response = await axios({
    method: 'get',
    url: 'https://graph.microsoft.com/v1.0/me/people',
    headers: {
      Authorization: `Bearer ${req.user.accessToken}`,
    },
  });
  res.send(response.data);
} catch (err) {
  console.error(err);
}
outlook microsoft-graph access
1个回答
0
投票

我猜是您使用的令牌没有足够的权限。根据GET /v1.0/me/peoplehttps://docs.microsoft.com/en-us/graph/api/user-list-people?view=graph-rest-1.0&tabs=http的文档,您需要People.ReadPeople.Read.All。您可以确认访问令牌中包含密码吗?

© www.soinside.com 2019 - 2024. All rights reserved.