none
REST API Decline Event RRS feed

  • Question

  • Hi All,

    I am trying to decline the event created.

    I had the id of the event which was created.

    My request includes

    Node.js Code :

                    

    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();

    This should actually go and decline the event.

    But the response is coming <g class="gr_ gr_297 gr-alert gr_gramm undefined Punctuation multiReplace" data-gr-id="297" id="297">as :</g> 

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

    ** I have checked that the event was present but still this error came.

    Thursday, December 17, 2015 12:01 PM

Answers

  • Hi Mohit,

    Thanks for posting in MSDN forum.

    Based on the error message, it seems that the event id is incorrect. I suggest that you check whether the event exits via the event id you were developing. We can get the event via the id via the request below:

     GET https://outlook.office.com/api/v2.0/me/events/{event_id}

    And you can get more detail about Calendar REST API from link below:
    https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#GetEvent

    This forum is mainly for discussing issues related to Office add-ins development. For this question, I would suggest you asking a question in Stack Overflow and tag your questions with [office365].

    The reason why I recommend posting appropriately is you will get the most qualified pool of respondents, and Office 365 developer team will also monitor the tag regularly.

    Thanks for your understanding.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 18, 2015 7:59 AM
    Moderator