2015-02-05 33 views
0

我無法獲得IsCancelled以更新事件,但我可以更新其他所有內容,並且在嘗試時我無錯誤。我的事件嘗試了ResponseRequested,它也是一個布爾數據類型。Office 365日曆事件「IsCancelled」不會更新

在這裏指出該值是可寫的:https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#EventResource

網址:https://outlook.office365.com/api/v1.0/me/events/EVENTID

體:

{ 
    "Subject": "Test", 
    "IsCancelled": true, 
    "ResponseRequested": true, 
    "ShowAs": "Free" 
} 

請求類型:PATCH

響應代碼:200

=====開始迴應b ODY =====

{ 
    "@odata.context":"https://outlook.office365.com/api/v1.0/$metadata#Me/Events/$entity", 
     "@odata.id":"https://outlook.office365.com/api/v1.0/Users('EMAILREMOVED')/Events('EVENTIDREMOVED')", 
    "@odata.etag":"W/\"REMOVED", 
    "Id":"EVENTIDREMOVED", 
    "ChangeKey":"REMOVED", 
    "Categories":[ 

    ], 
    "DateTimeCreated":"2015-02-05T20:16:58.2868803Z", 
    "DateTimeLastModified":"2015-02-05T20:30:05.7761882Z", 
    "Subject":"Test", 
    "BodyPreview":"Event Details: Invitee: NAMEREMOVED Invitee Email: EMAILREMOVED Note: Should you need to cancel the event, COMPANYNAMEREMOVED recommends you use the event cancellation feature in COMPANYNAMEREMOVED.", 
    "Body":{ 
     "ContentType":"HTML", 
     "Content":"<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\nEvent Details: Invitee: NAMEREMOVED Invitee Email: EMAILREMOVED Note: Should you need to cancel the event, COMPANYNAMEREMOVED recommends you use the event cancellation feature in COMPANYNAMEREMOVED.\r\n</body>\r\n</html>\r\n" 
    }, 
    "Importance":"Normal", 
    "HasAttachments":false, 
    "Start":"2015-02-06T21:30:00Z", 
    "End":"2015-02-06T21:45:00Z", 
    "Location":{ 
     "DisplayName":"" 
    }, 
    "ShowAs":"Free", 
    "IsAllDay":false, 
    "IsCancelled":false, 
    "IsOrganizer":true, 
    "ResponseRequested":true, 
    "Type":"SingleInstance", 
    "SeriesMasterId":null, 
    "Attendees":[ 
     { 
     "EmailAddress":{ 
      "Address":"EMAILREMOVED", 
      "Name":"NAMEREMOVED" 
     }, 
     "Status":{ 
      "Response":"None", 
      "Time":"0001-01-01T00:00:00Z" 
     }, 
     "Type":"Required" 
     }, 
     { 
     "EmailAddress":{ 
      "Address":"EMAILREMOVED", 
      "Name":"NAMEREMOVED" 
     }, 
     "Status":{ 
      "Response":"None", 
      "Time":"0001-01-01T00:00:00Z" 
     }, 
     "Type":"Required" 
     } 
    ], 
    "Recurrence":null, 
    "Organizer":{ 
     "EmailAddress":{ 
     "Address":"EMAILREMOVED", 
     "Name":"NAMEREMOVED" 
     } 
    } 
} 

=====端響應體=====

回答

2

這就是文檔中的錯誤。您無法直接更新該屬性。要取消一個事件,你只需刪除它。服務器將發送所有需要的取消。

+0

感謝您的幫助傑森 – 2015-02-06 15:52:05