查找会议时间在Microsoft图形API中,参数名称为attendees
如果我们有1名与会者,我的代码将会是这样的
{
"attendees": [
{
"type": "required",
"emailAddress": {
"name": "Fanny Downs",
"address": "fannyd@contoso.onmicrosoft.com"
}
}
],
"locationConstraint": {
"isRequired": "false",
"suggestLocation": "false",
"locations": [
{
"resolveAvailability": "false",
"displayName": "Conf room Hood"
}
]
},
"timeConstraint": {
"activityDomain":"unrestricted",
"timeslots": [
{
"start": {
"dateTime": "2017-04-17T09:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-19T17:00:00",
"timeZone": "Pacific Standard Time"
}
}
]
},
"meetingDuration": "PT2H",
"returnSuggestionReasons": "true",
"minimumAttendeePercentage": "100"
}
我尝试通过更改代码向此
添加更多与会者"attendees": [
{
"type": "required",
"emailAddress": {
"name": "Fanny Downs",
"address": "fannyd@contoso.onmicrosoft.com"
} ,
"emailAddress": {
"name": "Joey medapple",
"address": "joey@contoso.onmicrosoft.com"
}
}
]
但它无效
我怎么能添加其他与会者
答案 0 :(得分:1)
您将第二个人置于错误的级别。每个"与会者"应该看起来包含type
和emailAddress
:
"attendees": [{
"type": "required", // First Attendee
"emailAddress": {
"name": "Fanny Downs",
"address": "fannyd@contoso.onmicrosoft.com"
}
}, {
"type": "required", // Second Attendee
"emailAddress": {
"name": "Jonny Doe",
"address": "jdoe@contoso.onmicrosoft.com"
}
}, {
"type": "optional", // Third Attendee
"emailAddress": {
"name": "Dave Smith",
"address": "jdoe@contoso.onmicrosoft.com"
}
}],
所以你完整的请求应该是这样的:
{
"attendees": [{
"type": "required", // First Attendee
"emailAddress": {
"name": "Fanny Downs",
"address": "fannyd@contoso.onmicrosoft.com"
}
}, {
"type": "required", // Second Attendee
"emailAddress": {
"name": "Jonny Doe",
"address": "jdoe@contoso.onmicrosoft.com"
}
}, {
"type": "optional", // Third Attendee
"emailAddress": {
"name": "Dave Smith",
"address": "jdoe@contoso.onmicrosoft.com"
}
}],
"locationConstraint": {
"isRequired": "false",
"suggestLocation": "false",
"locations": [{
"resolveAvailability": "false",
"displayName": "Conf room Hood"
}]
},
"timeConstraint": {
"activityDomain": "unrestricted",
"timeslots": [{
"start": {
"dateTime": "2017-04-17T09:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2017-04-19T17:00:00",
"timeZone": "Pacific Standard Time"
}
}]
},
"meetingDuration": "PT2H",
"returnSuggestionReasons": "true",
"minimumAttendeePercentage": "100"
}