图API呼叫问题 - 发布事件
在尝试在特定用户日历中创建事件时,我会遇到问题。
此通话正常:post https://graph.microsoft.com/v1.0/ me/events
但是,当我将API调用更改为包含其他用户详细信息时,它会引发此错误:“商店中找不到指定的对象。”
我已经在Azure上创建了一个应用程序,并分配了所有必要的权限。
应用权限
错误:
如果我缺少某些东西,请有人请帮助吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,当您使用
/ME
时,这意味着您正在使用委托API许可调用MS Graph API,该权限通过输入用户名/密码来认证,您只能使用此使用此操作在您自己的帐户上进行操作一种身份验证。当您想为其他用户进行操作时,例如/user/user_id/xxx
,您需要应用程序API许可。这就是为什么 API文档在委派和应用程序
中显示API权限。一个用于个人,另一个用于所有用户。当我们需要获得访问令牌包含应用程序许可时,我们需要使用客户端凭据流。由于这种应用程序没有用户交互式操作,因此该流程用于守护程序应用程序,因此我们只能将应用程序许可用于此类情况。如您所见,它将为应用程序提供“非常大的能力”(允许应用程序为您的租户中的任何用户创建/更改/删除项目),因此我们需要谨慎使用应用许可。
回到案件中,您可以关注本节生成访问令牌并调用API。您还可以在代码中使用Graph SDK来调用该API。
Please note when you use
/me
, it means you are calling the ms graph api with a delegate api permission which is authentiated by entering user name/password, you can only do operations on your own account with this kind of authentication. While you want to do operations for other users like/users/user_id/xxx
, you required the application api permission. That's why api document showed api permission inDelegated and Application
. One for personal and another for all users.When we need to get access token contain application permission, we need to use client credential flow. This flow is used for daemon application since this kind of application doesn't have user interactive operation, so we can only use application permission for this kind of scenario. And as you can see it will offer "very big ability" to the application(allow application to create/change/delete items for any user in your tenant), so we need to use appliation permission with caution.
Come back to the case, you can follow this section to generate access token and call the api. You can also using graph SDK in your code to call that api.