Hi all,
I need to get “My Today’s Events” from my calendar on Office 365 using REST API and jQuery, however, I haven’t had any success so far. Have you guys used this API before? If so, can you please give me some hint how I can achieve this task.
Thanks in advance,
Parr
Thanks Balamurugan for your response.
The main issue that I am having is I can’t get any response back from that REST URL in my jQuery.
I tried below code, but didn’t work!
var calendarUrl = “https://outlook.office365.com/ews/odata/Me/Events”;
var data = $.ajax({
url: calendarUrl,Â
type: “GET”,
headers: { “accept”: “application/json;odata=verbose” },
//datatype: “json”,
success: function(data){
// do something
},
error: function(err){
// log the errorÂ
}
});
Also, I tried to SP RequestExecutor but still no success! Here is my code:
function execRequest() {
// var executor;
var executor = new SP.RequestExecutor(“/”);
executor.executeAsync(
{
url:”https://outlook.office365.com/ews/odata/Me/Events”,
method: “GET”,
headers: { “Accept”: “application/json; odata=verbose” },
success: successHandler,
error: errorHandler
}
);
}
function successHandler(data) {
var jsonObject = JSON.parse(data.body);
// generate my HTML snippet based on the JSON value
}
function errorHandler(data, errorCode, errorMessage) {
// log the error
}
I would appreciate your help 🙂
Cheers,
Parr
Hi,
Please try this.
https://outlook.office365.com/ews/odata/Me/Events?$filter=Start%20ge%202014-02-19T00:00:00Z%20%20and%20End%20le%202014-08-20T00:00:00Z%20&$select=Subject,Start,End
Thanks
BalamuruganK