2017-07-18 97 views
1

查找会议时间在微软图形API有参数名称attendeesMicrosoft Graph查找会议时间添加其他与会者?

,如果我们有1名与会者我的代码会看起来像这样

{ 
    "attendees": [ 
    { 
     "type": "required", 
     "emailAddress": { 
     "name": "Fanny Downs", 
     "address": "[email protected]" 
     } 
    } 
    ], 
    "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": "[email protected]" 
     } , 
     "emailAddress": { 
     "name": "Joey medapple", 
     "address": "[email protected]" 
     } 
    } 
    ] 

,但它不工作

我怎么可以添加其他与会者

回答

1

您将第二个人置于错误的级别。每个“与会者”应该同时包含typeemailAddress

"attendees": [{ 
    "type": "required", // First Attendee 
    "emailAddress": { 
     "name": "Fanny Downs", 
     "address": "[email protected]" 
    } 
}, { 
    "type": "required", // Second Attendee 
    "emailAddress": { 
     "name": "Jonny Doe", 
     "address": "[email protected]" 
    } 
}, { 
    "type": "optional", // Third Attendee 
    "emailAddress": { 
     "name": "Dave Smith", 
     "address": "[email protected]" 
    } 
}], 

所以你完全请求应该是这个样子:

{ 
    "attendees": [{ 
     "type": "required", // First Attendee 
     "emailAddress": { 
      "name": "Fanny Downs", 
      "address": "[email protected]" 
     } 
    }, { 
     "type": "required", // Second Attendee 
     "emailAddress": { 
      "name": "Jonny Doe", 
      "address": "[email protected]" 
     } 
    }, { 
     "type": "optional", // Third Attendee 
     "emailAddress": { 
      "name": "Dave Smith", 
      "address": "[email protected]" 
     } 
    }], 
    "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" 
} 
+1

它的工作!谢谢 – Joey

相关问题