David Brunelle
David Brunelle

Reputation: 6450

Create a team webinar using Graph API

I am trying to create a webinar in team using my user as the presenter. In order to do that, I used the tutorial that is provided by Microsoft at this page : https://learn.microsoft.com/en-us/graph/api/virtualeventsroot-post-webinars?view=graph-rest-1.0&tabs=http . The site is date at 2024-08-08, which is not that far ago so I would trust it.

For the moment, I use the Graph API Explorer as it simplified the login process (https://developer.microsoft.com/en-us/graph/graph-explorer)

I use the sample they give on the page (with no modification except the user and tenant id) :

{     
"displayName": "The Impact of Tech on Our Lives",
"description": {
  "contentType": "text",
  "content": "Discusses how technology has changed the way we communicate."
},
"startDateTime": {
  "dateTime": "2024-03-30T10:00:00", 
  "timeZone": "Pacific Standard Time" 
},
"endDateTime": {
  "dateTime": "2024-03-30T17:00:00", 
  "timeZone": "Pacific Standard Time" 
},
"audience": "organization",
"coOrganizers": [
  {
    "id": "7b7e1acd-a3e0-4533-8c1d-c1a4ca0b2e2b", 
    "tenantId": "77229959-e479-4a73-b6e0-ddac27be315c" 
  }
],
"settings": {
  "isAttendeeEmailNotificationEnabled": false
}

}

No matter what I do, I always get a 400: Bad Request with no explanations. I checked the autorization and they only mention VirtualEvent.ReadWrite for delegated user (which I do) and my user has it.

I tried the following

So my question is in two parts :

Note : Creating is the only thing I can't do. Once a webinar is created "manually", I can easily access its info.

Upvotes: 0

Views: 168

Answers (2)

user29399644
user29399644

Reputation: 1

I had the same issue, but I finally solved it. Even if the "400 Bad Request" error message doesn't mention any bad attribute format, the problem comes from the request body. In my case, it was “dateTime” which was in the past and “coOrganizers” which could not be the organizer itself and he need the "displayName" attribute. To observe this, I compared my body to the object returned when getting an existing webinar (created directly from Teams). The following body structure worked in my case :

{
    "audience": "everyone",
    "status": "draft",
    "displayName": "Webinar",
    "coOrganizers": [],
    "description": {
        "content": "",
        "contentType": "text"
    },
    "startDateTime": {
        "dateTime": "2025-02-28T20:00:00",
        "timeZone": "UTC"
    },
    "endDateTime": {
        "dateTime": "2025-02-28T23:00:00",
        "timeZone": "UTC"
    },
    "settings": {
        "isAttendeeEmailNotificationEnabled": false
    },
    "externalEventInformation": []
}

I hope this helps you.

Upvotes: 0

Mike Frye
Mike Frye

Reputation: 1

FYI: I got the same result, but when I did a graph call to list the events, they were there???

I saw in the docs that events created using this API dont appear in your calandar, but I cannot find that at this time...

Upvotes: 0

Related Questions