关于通过Microsoft Graph API为Microsoft Teams网络研讨会注册参会者的方法及API支持性咨询
Hey there! Let's break down your two questions clearly, with practical details you can use right away:
1. How to register attendees for a Teams webinar using Microsoft Graph API
To register an attendee, you'll use the registrants endpoint tied to the webinar's online meeting resource. Here's a step-by-step breakdown:
Prerequisites
- First, confirm you have the right permissions:
- Delegated (user) permission:
Webinars.ReadWrite - Application permission:
Webinars.ReadWrite.All
- Delegated (user) permission:
- The webinar must have
allowRegistrationset totrue(you can check this via theGET /users/{userId}/onlineMeetings/{meetingId}endpoint).
API Call Example
Send a POST request with the attendee's details and any required registration question answers:
POST https://graph.microsoft.com/v1.0/users/{userId}/onlineMeetings/{meetingId}/registration/registrants Content-Type: application/json { "firstName": "John", "lastName": "Doe", "email": "john.doe@contoso.com", "answers": [ { "questionId": "custom-project-question-001", "value": "Enterprise SaaS Implementation" } ] }
- Swap
{userId}with the webinar organizer's user ID or UPN. - Replace
{meetingId}with the unique ID of your Teams webinar (fetch this via the API when creating or listing webinars). - The
answersarray is optional if your webinar doesn't have custom registration questions.
After a successful request, the attendee will get an automated confirmation email with their unique webinar join link.
2. Does Microsoft Graph API support adding attendees to a Teams webinar?
Yes, but the approach depends on whether your webinar requires registration:
Scenario 1: Webinar doesn’t require registration (allowRegistration: false)
You can directly add attendees by updating the webinar's attendees collection with a PATCH request:
PATCH https://graph.microsoft.com/v1.0/users/{userId}/onlineMeetings/{meetingId} Content-Type: application/json { "attendees": [ { "emailAddress": { "address": "jane.smith@contoso.com", "name": "Jane Smith" }, "type": "required" } ] }
- Use
type: "required"to mark the attendee as mandatory, oroptionalif they’re not required to join. - Add multiple attendees at once by expanding the
attendeesarray with additional objects.
Scenario 2: Webinar requires registration (allowRegistration: true)
In this case, "adding an attendee" means completing the registration flow via the endpoint from question 1. Directly modifying the attendees collection won’t work here—you need to go through the registration process to ensure the attendee receives proper confirmation and valid join credentials.
Quick Notes
- Permissions for adding attendees match the registration requirements, or you can use
OnlineMeetings.ReadWritefor non-registration webinars. - Always check the webinar’s
allowRegistrationsetting first to pick the right API method.
内容的提问来源于stack exchange,提问作者shazim ali

