创建 meetingRegistrant
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
在代表注册人启用会议注册的联机会议中注册会议注册人。 此操作有两种方案:
- 如果 meetingRegistration 对象的 allowedRegistrant 属性的值为 ,则注册人需要先登录,然后才能
organization 注册会议。 firstName、lastName 和 email 必须匹配存储在 Azure Active Directory (Azure AD) 。
- 如果 meetingRegistration 对象的 allowedRegistrant 属性的值为 ,则注册人无需登录,并且
everyone 将被视为匿名。
在任一方案中,注册人将收到包含其注册信息的电子邮件通知。
Permissions
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
OnlineMeetings.ReadWrite |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
OnlineMeetings.Read.All |
提示
- 如果 meetingRegistration 对象的 allowedRegistrant 属性的值为 ,则使用注册人
organization 委派的权限进行注册。
- 如果 meetingRegistration 对象的 allowedRegistrant 属性的值为 ,则使用注册人
everyone 委派的权限进行注册。
HTTP 请求
POST /users/{userId}/onlineMeetings/{id}/registration/registrants
注意: userId是会议组织者的 objectID。
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
请求正文
在请求正文中,提供 meetingRegistrant 对象的可编辑属性的 JSON 表示形式。
重要
必须提供 @odata.type 属性以指定注册表类型。 有关详细信息,请参阅以下示例。
响应
如果成功,此方法在响应正文中返回 响应代码和 200 OK 部分 meetingRegistrant 对象。
提示
响应正文将包含不同的信息,具体取决于 allowedRegistrant 的值。
- 如果 allowedRegistrant 属性的值为 ,则 meetingRegistrant 对象中将仅返回 id 和
organization joinWebUrl。 注册表者可以使用 id 取消注册,或使用 joinWebUrl 加入会议。
- 如果 allowedRegistrant 属性的值为 ,将返回一个空
everyone meetingRegistrant 对象。 注册人需要使用他们收到的电子邮件中的链接来取消注册或加入会议。
示例
示例 1:注册登录注册人
以下示例显示当会议将 allowedRegistrant 设置为 时,如何使用注册表的委派权限注册已登录的注册表 organization 。
请求
POST https://graph.microsoft.com/beta/users/16664f75-11dc-4870-bec6-38c1aaa81431/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.meetingRegistrant",
"firstName": "Frederick",
"lastName": "Cormier",
"email": "frederick.cormier@contoso.com",
"customQuestionAnswers": [
{
"questionId": "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
"value": "No"
},
{
"questionId": "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
"value": "Internet"
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var meetingRegistrantBase = new MeetingRegistrant
{
FirstName = "Frederick",
LastName = "Cormier",
Email = "frederick.cormier@contoso.com",
CustomQuestionAnswers = new List<CustomQuestionAnswer>()
{
new CustomQuestionAnswer
{
QuestionId = "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
Value = "No"
},
new CustomQuestionAnswer
{
QuestionId = "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
Value = "Internet"
}
}
};
await graphClient.Users["{user-id}"].OnlineMeetings["{onlineMeeting-id}"].Registration.Registrants
.Request()
.AddAsync(meetingRegistrantBase);
const options = {
authProvider,
};
const client = Client.init(options);
const meetingRegistrantBase = {
'@odata.type': '#microsoft.graph.meetingRegistrant',
firstName: 'Frederick',
lastName: 'Cormier',
email: 'frederick.cormier@contoso.com',
customQuestionAnswers: [
{
questionId: 'MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=',
value: 'No'
},
{
questionId: 'MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=',
value: 'Internet'
}
]
};
await client.api('/users/16664f75-11dc-4870-bec6-38c1aaa81431/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants')
.version('beta')
.post(meetingRegistrantBase);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/users/16664f75-11dc-4870-bec6-38c1aaa81431/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphMeetingRegistrantBase *meetingRegistrantBase = [[MSGraphMeetingRegistrantBase alloc] init];
[meetingRegistrantBase setFirstName:@"Frederick"];
[meetingRegistrantBase setLastName:@"Cormier"];
[meetingRegistrantBase setEmail:@"frederick.cormier@contoso.com"];
NSMutableArray *customQuestionAnswersList = [[NSMutableArray alloc] init];
MSGraphCustomQuestionAnswer *customQuestionAnswers = [[MSGraphCustomQuestionAnswer alloc] init];
[customQuestionAnswers setQuestionId:@"MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU="];
[customQuestionAnswers setValue:@"No"];
[customQuestionAnswersList addObject: customQuestionAnswers];
MSGraphCustomQuestionAnswer *customQuestionAnswers = [[MSGraphCustomQuestionAnswer alloc] init];
[customQuestionAnswers setQuestionId:@"MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8="];
[customQuestionAnswers setValue:@"Internet"];
[customQuestionAnswersList addObject: customQuestionAnswers];
[meetingRegistrantBase setCustomQuestionAnswers:customQuestionAnswersList];
NSError *error;
NSData *meetingRegistrantBaseData = [meetingRegistrantBase getSerializedDataWithError:&error];
[urlRequest setHTTPBody:meetingRegistrantBaseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
MeetingRegistrant meetingRegistrantBase = new MeetingRegistrant();
meetingRegistrantBase.firstName = "Frederick";
meetingRegistrantBase.lastName = "Cormier";
meetingRegistrantBase.email = "frederick.cormier@contoso.com";
LinkedList<CustomQuestionAnswer> customQuestionAnswersList = new LinkedList<CustomQuestionAnswer>();
CustomQuestionAnswer customQuestionAnswers = new CustomQuestionAnswer();
customQuestionAnswers.questionId = "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=";
customQuestionAnswers.value = "No";
customQuestionAnswersList.add(customQuestionAnswers);
CustomQuestionAnswer customQuestionAnswers1 = new CustomQuestionAnswer();
customQuestionAnswers1.questionId = "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=";
customQuestionAnswers1.value = "Internet";
customQuestionAnswersList.add(customQuestionAnswers1);
meetingRegistrantBase.customQuestionAnswers = customQuestionAnswersList;
graphClient.users("16664f75-11dc-4870-bec6-38c1aaa81431").onlineMeetings("MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ").registration().registrants()
.buildRequest()
.post(meetingRegistrantBase);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewMeetingRegistrant()
firstName := "Frederick"
requestBody.SetFirstName(&firstName)
lastName := "Cormier"
requestBody.SetLastName(&lastName)
email := "frederick.cormier@contoso.com"
requestBody.SetEmail(&email)
requestBody.SetCustomQuestionAnswers( []CustomQuestionAnswer {
msgraphsdk.NewCustomQuestionAnswer(),
SetAdditionalData(map[string]interface{}{
"questionId": "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
"value": "No",
}
msgraphsdk.NewCustomQuestionAnswer(),
SetAdditionalData(map[string]interface{}{
"questionId": "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
"value": "Internet",
}
}
options := &msgraphsdk.RegistrantsRequestBuilderPostOptions{
Body: requestBody,
}
userId := "user-id"
onlineMeetingId := "onlineMeeting-id"
result, err := graphClient.UsersById(&userId).OnlineMeetingsById(&onlineMeetingId).Registration().Registrants().Post(options)
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('16664f75-11dc-4870-bec6-38c1aaa81431')/onlineMeetings('MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ')/registration/registrants/$entity",
"@odata.type": "#microsoft.graph.meetingRegistrant",
"id": "gWWckDBR6UOI8_yzWCzeNw,6pAAiSU1bkGqzLnbHG_muA,bzLh6uR-5EGYsCvtvIvs6Q,E4jbleVFdE6BDf6ei3YBOA,KvXQzK4zfU-5LQj_ZLWgow,A7_SArco00S-Qr707l0vBA,UFakyZrk1K9vBacExW1muA",
"registrationDateTime": null,
"joinWebUrl": "https://teams.microsoft.com/l/meetup-join/19%3ameeting_MmE4Mzg1OTItYjg2Ni00ZmNmLWI5NjMtODNkZDJiMWNlNTVi%40thread.v2/0?context=%7b%22Tid%22%3a%22909c6581-5131-43e9-88f3-fcb3582cde37%22%2c%22Oid%22%3a%22dc17674c-81d9-4adb-bfb2-8f6a442e4622%22%2c%22prid%22%3a%22gWWckDBR6UOI8_yzWCzeNw%2c6pAAiSa1bkGqzLnbHG_muA%2cbzLh6uR-5EGdsCvtvIvs6Q%2cE4jbleVFdE6BDf6ei3YBOA%2cKvXQzK4zfU-5LQj_ZLWgow%2cA7_SArco00S-Qr707l0vBA%2cUFaiyZrk1K9vBacExW1muA%22%2c%22isPublic%22%3afalse%7d",
"firstName": null,
"lastName": null,
"email": null,
"status": null,
"customQuestionAnswers": []
}
示例 2:注册匿名注册人
以下示例演示当会议将 allowedRegistrant 设置为 时,如何注册具有应用程序权限的匿名注册人 everyone 。
请求
POST https://graph.microsoft.com/beta/users/dc17674c-81d9-4adb-bfb2-8f6a442e4622/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.meetingRegistrant",
"firstName": "Lisa",
"lastName": "Adkins",
"email": "lisa.adkins@contoso.com",
"customQuestionAnswers": [
{
"questionId": "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
"value": "No"
},
{
"questionId": "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
"value": "Internet"
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var meetingRegistrantBase = new MeetingRegistrant
{
FirstName = "Lisa",
LastName = "Adkins",
Email = "lisa.adkins@contoso.com",
CustomQuestionAnswers = new List<CustomQuestionAnswer>()
{
new CustomQuestionAnswer
{
QuestionId = "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
Value = "No"
},
new CustomQuestionAnswer
{
QuestionId = "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
Value = "Internet"
}
}
};
await graphClient.Users["{user-id}"].OnlineMeetings["{onlineMeeting-id}"].Registration.Registrants
.Request()
.AddAsync(meetingRegistrantBase);
const options = {
authProvider,
};
const client = Client.init(options);
const meetingRegistrantBase = {
'@odata.type': '#microsoft.graph.meetingRegistrant',
firstName: 'Lisa',
lastName: 'Adkins',
email: 'lisa.adkins@contoso.com',
customQuestionAnswers: [
{
questionId: 'MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=',
value: 'No'
},
{
questionId: 'MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=',
value: 'Internet'
}
]
};
await client.api('/users/dc17674c-81d9-4adb-bfb2-8f6a442e4622/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants')
.version('beta')
.post(meetingRegistrantBase);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/users/dc17674c-81d9-4adb-bfb2-8f6a442e4622/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/registrants"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphMeetingRegistrantBase *meetingRegistrantBase = [[MSGraphMeetingRegistrantBase alloc] init];
[meetingRegistrantBase setFirstName:@"Lisa"];
[meetingRegistrantBase setLastName:@"Adkins"];
[meetingRegistrantBase setEmail:@"lisa.adkins@contoso.com"];
NSMutableArray *customQuestionAnswersList = [[NSMutableArray alloc] init];
MSGraphCustomQuestionAnswer *customQuestionAnswers = [[MSGraphCustomQuestionAnswer alloc] init];
[customQuestionAnswers setQuestionId:@"MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU="];
[customQuestionAnswers setValue:@"No"];
[customQuestionAnswersList addObject: customQuestionAnswers];
MSGraphCustomQuestionAnswer *customQuestionAnswers = [[MSGraphCustomQuestionAnswer alloc] init];
[customQuestionAnswers setQuestionId:@"MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8="];
[customQuestionAnswers setValue:@"Internet"];
[customQuestionAnswersList addObject: customQuestionAnswers];
[meetingRegistrantBase setCustomQuestionAnswers:customQuestionAnswersList];
NSError *error;
NSData *meetingRegistrantBaseData = [meetingRegistrantBase getSerializedDataWithError:&error];
[urlRequest setHTTPBody:meetingRegistrantBaseData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
MeetingRegistrant meetingRegistrantBase = new MeetingRegistrant();
meetingRegistrantBase.firstName = "Lisa";
meetingRegistrantBase.lastName = "Adkins";
meetingRegistrantBase.email = "lisa.adkins@contoso.com";
LinkedList<CustomQuestionAnswer> customQuestionAnswersList = new LinkedList<CustomQuestionAnswer>();
CustomQuestionAnswer customQuestionAnswers = new CustomQuestionAnswer();
customQuestionAnswers.questionId = "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=";
customQuestionAnswers.value = "No";
customQuestionAnswersList.add(customQuestionAnswers);
CustomQuestionAnswer customQuestionAnswers1 = new CustomQuestionAnswer();
customQuestionAnswers1.questionId = "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=";
customQuestionAnswers1.value = "Internet";
customQuestionAnswersList.add(customQuestionAnswers1);
meetingRegistrantBase.customQuestionAnswers = customQuestionAnswersList;
graphClient.users("dc17674c-81d9-4adb-bfb2-8f6a442e4622").onlineMeetings("MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ").registration().registrants()
.buildRequest()
.post(meetingRegistrantBase);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewMeetingRegistrant()
firstName := "Lisa"
requestBody.SetFirstName(&firstName)
lastName := "Adkins"
requestBody.SetLastName(&lastName)
email := "lisa.adkins@contoso.com"
requestBody.SetEmail(&email)
requestBody.SetCustomQuestionAnswers( []CustomQuestionAnswer {
msgraphsdk.NewCustomQuestionAnswer(),
SetAdditionalData(map[string]interface{}{
"questionId": "MSM5YjlmM2Q4ZS03ZmVkLTRmN3gwMDIw94MDAyMF9hX3gwMDIwX2RldmU=",
"value": "No",
}
msgraphsdk.NewCustomQuestionAnswer(),
SetAdditionalData(map[string]interface{}{
"questionId": "MSM5M2E2OWQ1Ni1jZTc4LTQDAwMjBfZGlkX3gwMDIwX3lvdV94MDAyMF8=",
"value": "Internet",
}
}
options := &msgraphsdk.RegistrantsRequestBuilderPostOptions{
Body: requestBody,
}
userId := "user-id"
onlineMeetingId := "onlineMeeting-id"
result, err := graphClient.UsersById(&userId).OnlineMeetingsById(&onlineMeetingId).Registration().Registrants().Post(options)
响应
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('16664f75-11dc-4870-bec6-38c1aaa81431')/onlineMeetings('MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ')/registration/registrants/$entity",
"@odata.type": "#microsoft.graph.meetingRegistrant",
"id": "",
"registrationDateTime": null,
"joinWebUrl": "",
"firstName": null,
"lastName": null,
"email": null,
"status": null,
"customQuestionAnswers": []
}