Microsoft Graph API OnlineMeetings 错误 - 不应为空 参数名称: 会议 [英] Microsoft Graph API OnlineMeetings Error - Expected not null Parameter name: meeting

查看:10
本文介绍了Microsoft Graph API OnlineMeetings 错误 - 不应为空 参数名称: 会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个调用 Microsoft Graph API 以生成 Microsoft Teams 会议链接的 Slack 应用程序.

I am working on a slack app that calls Microsoft Graph API in order to generate a Microsoft Teams meeting link.

我能够生成访问令牌,但出现错误:

I am able to generate an access token, however I am getting the error:

{
    "error": {
        "code": "InvalidArgument",
        "message": "Expected not null
Parameter name: meeting",
    }
}

这是我的发帖请求:

POST https://graph.microsoft.com/v1.0/me/onlineMeetings

{
    "subject":"User Token Meeting",
    "startDateTime": "2020-12-28T14:30:34.2444915-07:00",
    "endDateTime": "2020-12-29T15:00:34.2464912-07:00"
}

除了这三个元素和不记名令牌之外,Microsoft Graph 文档没有提到要在 POST 中包含的任何其他内容,所以我对参数名称的含义感到困惑:会议.如果有人可以帮助我,我将不胜感激.

The Microsoft Graph docs don't mention anything else to include in the POST besides these three elements and the bearer token, so I'm confused as to what it means when it says parameter name: meeting. I would really appreciate it if someone could help me out.

作为参考,如果这很重要,应用程序不会获取用户凭据,而是自行完成所有操作,包括生成自己的访问令牌.

For reference if this matters, the application doesn't take user credentials, and does everything on its own, including generating its own access token.

推荐答案

正如评论中提到的,participants属性应该添加到请求体中,虽然官方文档没有提到这个属性是必要的.请求应该是这样的:

As mentioned in comment, the property participants should be added in request body although the official document doesn't mentioned this property is necessary. The request should be like:

{
  "startDateTime":"2019-09-09T14:33:30.8546353-07:00",
  "endDateTime":"2019-09-09T15:03:30.8566356-07:00",
  "subject":"Application Token Meeting",
  "participants": {
    "organizer": {
      "identity": {
        "user": {
          "id": "550fae72-d251-43ec-868c-373732c2704f"
        }
      }
    }
  }
}

正如艾伦在您的下一个 post,请不要在请求 url 中使用 Application Object ID,而应使用 user id.

And as Allen mentioned in your next post, you should not use the Application Object ID in the request url, you need to use the user id instead.

这篇关于Microsoft Graph API OnlineMeetings 错误 - 不应为空 参数名称: 会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆