创建 meetingRegistrationQuestion
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
代表 组织者创建与 meetingRegistration 对象关联的自定义注册问题。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
OnlineMeetings.ReadWrite |
| 委派(个人 Microsoft 帐户) |
不支持。 |
| 应用程序 |
不支持。 |
HTTP 请求
POST /me/onlineMeetings/{id}/registration/microsoft.graph.meetingRegistration/customQuestions
提示
若要访问 /customQuestions ,请按照 示例将注册类型强制转换到 meetingRegistration。
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
请求正文
在请求正文中,提供 meetingRegistrationQuestion 对象的可写属性的 JSON 表示形式。
响应
如果成功,此方法在响应正文中返回 响应代码和 201 Created meetingRegistrationQuestion 对象。
示例
请求
POST https://graph.microsoft.com/beta/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/microsoft.graph.meetingRegistration/customQuestions
Content-Type: application/json
{
"displayName": "What's your job position?",
"isRequired": false,
"answerInputType": "text"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var meetingRegistrationQuestion = new MeetingRegistrationQuestion
{
DisplayName = "What's your job position?",
IsRequired = false,
AnswerInputType = AnswerInputType.Text
};
await graphClient.Me.OnlineMeetings["{onlineMeeting-id}"].Registration.CustomQuestions
.Request()
.AddAsync(meetingRegistrationQuestion);
const options = {
authProvider,
};
const client = Client.init(options);
const meetingRegistrationQuestion = {
displayName: 'What\'s your job position?',
isRequired: false,
answerInputType: 'text'
};
await client.api('/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/microsoft.graph.meetingRegistration/customQuestions')
.version('beta')
.post(meetingRegistrationQuestion);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/onlineMeetings/MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ/registration/microsoft.graph.meetingRegistration/customQuestions"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphMeetingRegistrationQuestion *meetingRegistrationQuestion = [[MSGraphMeetingRegistrationQuestion alloc] init];
[meetingRegistrationQuestion setDisplayName:@"What's your job position?"];
[meetingRegistrationQuestion setIsRequired: false];
[meetingRegistrationQuestion setAnswerInputType: [MSGraphAnswerInputType text]];
NSError *error;
NSData *meetingRegistrationQuestionData = [meetingRegistrationQuestion getSerializedDataWithError:&error];
[urlRequest setHTTPBody:meetingRegistrationQuestionData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
MeetingRegistrationQuestion meetingRegistrationQuestion = new MeetingRegistrationQuestion();
meetingRegistrationQuestion.displayName = "What's your job position?";
meetingRegistrationQuestion.isRequired = false;
meetingRegistrationQuestion.answerInputType = AnswerInputType.TEXT;
graphClient.me().onlineMeetings("MSpkYzE3Njc0Yy04MWQ5LTRhZGItYmZ").registration().microsoft.graph.meetingRegistration().customQuestions()
.buildRequest()
.post(meetingRegistrationQuestion);
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
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/microsoft.graph.meetingRegistration/customQuestions/$entity",
"id": "MSNhYjc5NWI4MC119zX3gwMDIwX3lvdXJfeDAwMjBfam8=",
"displayName": "What's your job position?",
"isRequired": false,
"answerInputType": "text",
"answerOptions": []
}