创建 meetingRegistration
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
代表组织者创建 并启用 onlineMeeting 注册。 联机会议只能启用一个注册。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
OnlineMeetings.ReadWrite |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
不支持。 |
HTTP 请求
POST /me/onlineMeetings/{id}/registration
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
| Accept-Language |
语言。 可选。 |
请求正文
在请求正文中,提供 meetingRegistration 对象的 JSON 表示形式。
重要
必须提供 @odata.type 属性以指定注册类型。 有关详细信息,请参阅 以下示例。
响应
如果成功,此方法在响应 201 Created 正文中返回 响应代码和 meetingRegistration 对象。
示例
请求
POST https://graph.microsoft.com/beta/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.meetingRegistration",
"subject":"Microsoft Ignite",
"description": "Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more.",
"startDateTime":"2021-11-02T08:00:00-08:00",
"endDateTime":"2021-11-04T04:00:00-08:00",
"allowedRegistrant": "everyone",
"speakers": [
{
"displayName": "Henry Ross",
"bio": "Chairman and Chief Executive Officer"
},
{
"displayName": "Hailey Clark",
"bio": "EVP"
}
],
"customQuestions": [
{
"displayName": "Are you a developer?",
"answerInputType": "radioButton",
"answerOptions": [ "Yes", "No" ],
"isRequired": true
},
{
"displayName": "Where did you hear about us?",
"answerInputType": "text",
"isRequired": false
}
]
}
const options = {
authProvider,
};
const client = Client.init(options);
const meetingRegistration = {
'@odata.type': '#microsoft.graph.meetingRegistration',
subject: 'Microsoft Ignite',
description: 'Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more.',
startDateTime: '2021-11-02T08:00:00-08:00',
endDateTime: '2021-11-04T04:00:00-08:00',
allowedRegistrant: 'everyone',
speakers: [
{
displayName: 'Henry Ross',
bio: 'Chairman and Chief Executive Officer'
},
{
displayName: 'Hailey Clark',
bio: 'EVP'
}
],
customQuestions: [
{
displayName: 'Are you a developer?',
answerInputType: 'radioButton',
answerOptions: [ 'Yes', 'No' ],
isRequired: true
},
{
displayName: 'Where did you hear about us?',
answerInputType: 'text',
isRequired: false
}
]
};
await client.api('/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration')
.version('beta')
.post(meetingRegistration);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphMeetingRegistration *meetingRegistration = [[MSGraphMeetingRegistration alloc] init];
[meetingRegistration setSubject:@"Microsoft Ignite"];
[meetingRegistration setDescription:@"Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more."];
[meetingRegistration setStartDateTime: "2021-11-02T16:00:00+00:00"];
[meetingRegistration setEndDateTime: "2021-11-04T12:00:00+00:00"];
[meetingRegistration setAllowedRegistrant: [MSGraphMeetingAudience everyone]];
NSMutableArray *speakersList = [[NSMutableArray alloc] init];
MSGraphMeetingSpeaker *speakers = [[MSGraphMeetingSpeaker alloc] init];
[speakers setDisplayName:@"Henry Ross"];
[speakers setBio:@"Chairman and Chief Executive Officer"];
[speakersList addObject: speakers];
MSGraphMeetingSpeaker *speakers = [[MSGraphMeetingSpeaker alloc] init];
[speakers setDisplayName:@"Hailey Clark"];
[speakers setBio:@"EVP"];
[speakersList addObject: speakers];
[meetingRegistration setSpeakers:speakersList];
NSMutableArray *customQuestionsList = [[NSMutableArray alloc] init];
MSGraphMeetingRegistrationQuestion *customQuestions = [[MSGraphMeetingRegistrationQuestion alloc] init];
[customQuestions setDisplayName:@"Are you a developer?"];
[customQuestions setAnswerInputType: [MSGraphAnswerInputType radioButton]];
NSMutableArray *answerOptionsList = [[NSMutableArray alloc] init];
[answerOptionsList addObject: @"Yes"];
[answerOptionsList addObject: @"No"];
[customQuestions setAnswerOptions:answerOptionsList];
[customQuestions setIsRequired: true];
[customQuestionsList addObject: customQuestions];
MSGraphMeetingRegistrationQuestion *customQuestions = [[MSGraphMeetingRegistrationQuestion alloc] init];
[customQuestions setDisplayName:@"Where did you hear about us?"];
[customQuestions setAnswerInputType: [MSGraphAnswerInputType text]];
[customQuestions setIsRequired: false];
[customQuestionsList addObject: customQuestions];
[meetingRegistration setCustomQuestions:customQuestionsList];
NSError *error;
NSData *meetingRegistrationData = [meetingRegistration getSerializedDataWithError:&error];
[urlRequest setHTTPBody:meetingRegistrationData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
MeetingRegistration meetingRegistration = new MeetingRegistration();
meetingRegistration.subject = "Microsoft Ignite";
meetingRegistration.description = "Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more.";
meetingRegistration.startDateTime = OffsetDateTimeSerializer.deserialize("2021-11-02T16:00:00+00:00");
meetingRegistration.endDateTime = OffsetDateTimeSerializer.deserialize("2021-11-04T12:00:00+00:00");
meetingRegistration.allowedRegistrant = MeetingAudience.EVERYONE;
LinkedList<MeetingSpeaker> speakersList = new LinkedList<MeetingSpeaker>();
MeetingSpeaker speakers = new MeetingSpeaker();
speakers.displayName = "Henry Ross";
speakers.bio = "Chairman and Chief Executive Officer";
speakersList.add(speakers);
MeetingSpeaker speakers1 = new MeetingSpeaker();
speakers1.displayName = "Hailey Clark";
speakers1.bio = "EVP";
speakersList.add(speakers1);
meetingRegistration.speakers = speakersList;
LinkedList<MeetingRegistrationQuestion> customQuestionsList = new LinkedList<MeetingRegistrationQuestion>();
MeetingRegistrationQuestion customQuestions = new MeetingRegistrationQuestion();
customQuestions.displayName = "Are you a developer?";
customQuestions.answerInputType = AnswerInputType.RADIO_BUTTON;
LinkedList<String> answerOptionsList = new LinkedList<String>();
answerOptionsList.add("Yes");
answerOptionsList.add("No");
customQuestions.answerOptions = answerOptionsList;
customQuestions.isRequired = true;
customQuestionsList.add(customQuestions);
MeetingRegistrationQuestion customQuestions1 = new MeetingRegistrationQuestion();
customQuestions1.displayName = "Where did you hear about us?";
customQuestions1.answerInputType = AnswerInputType.TEXT;
customQuestions1.isRequired = false;
customQuestionsList.add(customQuestions1);
MeetingRegistrationQuestionCollectionResponse meetingRegistrationQuestionCollectionResponse = new MeetingRegistrationQuestionCollectionResponse();
meetingRegistrationQuestionCollectionResponse.value = customQuestionsList;
MeetingRegistrationQuestionCollectionPage meetingRegistrationQuestionCollectionPage = new MeetingRegistrationQuestionCollectionPage(meetingRegistrationQuestionCollectionResponse, null);
meetingRegistration.customQuestions = meetingRegistrationQuestionCollectionPage;
graphClient.me().onlineMeetings("MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ").registration()
.buildRequest()
.post(meetingRegistration);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.meetingRegistration",
"subject": "Microsoft Ignite",
"description": "Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more.",
"startDateTime": "2021-11-02T08:00:00-08:00",
"endDateTime": "2021-11-04T04:00:00-08:00",
"allowedRegistrant": "everyone",
"speakers": []Object {
}
"customQuestions": []Object {
}
}
onlineMeetingId := "onlineMeeting-id"
graphClient.Me().OnlineMeetingsById(&onlineMeetingId).Registration().Post(requestBody)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users('16664f75-11dc-4870-bec6-38c1aaa81431')/onlineMeetings('MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ')/registration/$entity",
"@odata.type": "#microsoft.graph.meetingRegistration",
"id": "gWWckDBR6UOI8_yzWCzeNw,6pAAiSU1bkGqzLnbHG_muA,bzLh6uR-5EGYsCvtvIvs6Q,2Hui7cZ3e0m1BblvyhKFaw,Bcn5itxWh0ui5zRxG26Akw,XCvoVSOmK0e9fivLeKuR_w",
"registrationPageWebUrl": "https://teams.microsoft.com/registration/gWWckDBR6UOI8_yzWCzeNw,6pABiSU1bkGqzLnbHG_muA,bzLh6uR-5EGYsCvtvIvs6Q,luiTigKrcUGE6Cm33MyQgA,29OIGSH4skyQNu6mNxJr3w,m2bnpmqE_EqwV1Q8dr280E?mode=read&tenantId=eefc0b3a-a334-4fb7-ac60-2f1cf13ec00d",
"allowedRegistrant": "everyone",
"subject": "Microsoft Ignite",
"description": "Join us November 2–4, 2021 to explore the latest tools, training sessions, technical expertise, networking opportunities, and more.",
"startDateTime": "2021-11-02T016:00:00Z",
"endDateTime": "2021-11-04T12:00:00Z",
"registrationPageViewCount": null,
"speakers": [
{
"displayName": "Henry Ross",
"bio": "Chairman and Chief Executive Officer"
},
{
"displayName": "Hailey Clark",
"bio": "EVP"
}
]
}