Search code examples
azure-active-directorymicrosoft-graph-api

Microsoft Graph API OnlineMeetings Error - Expected not null\r\nParameter name: meeting


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\r\nParameter name: meeting",
    }
}

This is my post request:

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"
}

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.


Solution

  • 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"
            }
          }
        }
      }
    }
    

    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.