OUTLOOK REST API 使用 Node.js 拒绝活动

OUTLOOK REST API Declining an Event using Node.js

我正在尝试拒绝使用 Outlook REST API 创建的活动。我有 创建的事件。我的请求包括 Node.js 代码:

var body =JSON.stringify(
    {
        "Comment": "Sorry, maybe next time!",
        "SendResponse": "true"
    });
    var options1 = {
                host : 'outlook.office365.com',
                port : 443,
                method : 'POST',
                headers : {
                        'Authorization' : 'Bearer' + token,
                        'Content-Type': 'application/json',
        'Content-Length': Buffer.byteLength(body)   
            },
            json : body,
            path : '/api/v2.0/me/events/EVENT_ID_RECEIVED/decline'   
                }
     };
var str=""; 
     var apiCall=https.request(options1,function(response){

        response.on('data',function(chunk){
            str += chunk;
        });
        response.on('end' , function(){
            console.log("data received is : "+response.data);
            console.log("value is : "+str);
        });
        response.on('error', function(e) {
                      console.log("error received : "+e.message);
               });

    });
    apiCall.write(body);
    apiCall.end();

我已经检查过该事件存在,但仍然出现此错误。

样品申请

POST //api/v2.0/me/events/GeneratedEventIdWhileCreatingCalender/decline HTTP/1.1
Host: outlook.office365.com    
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 9c925f4a-58df-4409-ca51-278590cfddd1    
{"Comment":"Sorry,maybe next time!","SendResponse":"true"}

示例响应 Headers

Access-Control-Allow-Origin → *
Access-Control-Max-Age → 86400
Cache-Control → private
Content-Type → application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false;charset=utf-8
Date → Fri, 18 Dec 2015 05:02:29 GMT
OData-Version → 4.0
Server → Microsoft-IIS/8.0
Transfer-Encoding → chunked
X-AspNet-Version → 4.0.30319
X-BEServer → HK2PR0301MB1154
X-BackEndHttpStatus → 404
X-CalculatedBETarget → HK2PR0301MB1154.apcprd03.prod.outlook.com
X-DiagInfo → HK2PR0301MB1154
X-Powered-By → ASP.NET
request-id → 6ab4e13e-f8bd-45c8-a80a-c31f8c580141

示例响应 Body

{
  "error": {
    "code": "ErrorItemNotFound",
    "message": "The specified object was not found in the store."
  }
}

有一个名为 iCalUid 的 属性,它在组织者和参加者的邮箱中对于一个活动是相同的。但是,似乎尚不支持使用此 属性 的 $filter。我们会考虑添加这个。同时,如果您知道事件的其他详细信息,例如开始时间和结束时间,则可以询问该时间范围内的所有事件,并通过比较事件的 iCalUid 属性 来确认您拒绝了正确的事件与会者邮箱中活动的 iCalUid 属性 的组织者邮箱。