Search code examples
restcalendarlive

Retrieving Microsoft Live calendar events between 2 dates


I'm currently working on requesting a list of events between 2 dates via Microsoft Live's REST API. I am able to pull back a list of events through the following request URL:

https://apis.live.net/v5.0/me/events

However, this returns a list of events that does not have any specific date frame. For example, I'd want to call a request similar to this:

https://apis.live.net/v5.0/me/events?startDate=2015-02-15&endDate=2015-03-15

I haven't been able to find any useful Microsoft documentation in their disorganized mess of "documentation", so my questions are:

1 - What changes need to be made to the first endpoint above for something like this to work?

2 - What time format does Microsoft use for this kind of request?

Thanks!


Solution

  • I finally found the answer in the middle of a Microsoft documentation page.

    Get a limited number of events based on their starting and ending times in Coordinated Universal Time (UTC) format by using the start_time and end_time parameters

    To answer my own questions:

    #1 - The following endpoint works:

    https://apis.live.net/v5.0/me/events?start_time=2015-02-15T00:00:00Z&end_time=2015-03-15T00:00:00Z
    

    #2 - The time format is as follows:

    yyyy-MM-dd'T'HH:mm:ss'Z'