2017-10-14 50 views
1

我正在嘗試使用Microsoft Graph來接受會議請求。無法接受事件

首先,我用:

GET /me/messages/{longMessageId}?expand=microsoft.graph.eventMessage/event 

我得到這樣的迴應:

{ 
    "id": "longMessageId", 
    "meetingMessageType": "meetingRequest", 
    "body": { 
     // ... 
    }, 
    "sender": { 
     // ... 
    }, 
    // ... 
    "event": { 
     "id": "longEventId", 
     "iCalUId": "longICalUId", 
     "attendees": [ 
      // ... 
     ], 
     "organizer": { 
      // ... 
     } 
     // ... 
    } 
} 

我設置了訪問Calendars.ReadWrite第一。然後我試着接受事件:

POST /me/events/{longEventId}/accept 

不過,我得到這個錯誤:

{ 
    "error": { 
     "code": "InternalServerError", 
     "message": "Object reference not set to an instance of an object.", 
     "innerError": { 
      "request-id": "882ea5ad-1d92-4f40-95fc-fceab143f0c0", 
      "date": "2017-10-14T23:29:21" 
     } 
    } 
} 

回答

2

確保如果你發送Content-Type頭設置爲application/json,你送一個擁有POST的機構。例如:

{ 
    "sendResponse": true 
} 

如果你不想送的身體,請確保您刪除Content-Type頭。