2017-07-18 47 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

相關問題