示例#1
0
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            var token = tmgr.AcquireToken(Settings.ResourceUrlOfGraph);

            var api = new Graph.GraphMailAPI(token);

            var result = api.GetMessages().Result;
        }
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            // var token = tmgr.AcquireToken("https://api.office.com/discovery/");

            var token = tmgr.AcquireToken("https://microsoft320-my.sharepoint.com/");

            var api = new O365.ServiceDiscoveryAPI(token);

            var services = api.GetServicesAsync().Result;

            Console.WriteLine(services.ToString());
        }
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            var token = tmgr.AcquireToken(Settings.ResourceUrlOfExchangeOnline);

            var api = new O365.OutlookNotificationsAPI(token);

            var task = api.Subscribe("me/events", "Created, Updated, Deleted");

            task.Wait();

            var result = task.Result;

            Console.WriteLine(result.ToString());
        }
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            var token = tmgr.AcquireToken(Settings.ResourceUrlOfExchangeOnline);

            var api = new O365.OutlookMessageAPI(token);

            var result = api.GetMessagesAsync().Result;

            var value = result.GetValue("value") as JArray;

            var length = value.Count;

            Console.WriteLine(result.ToString());
        }
示例#5
0
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            var token = tmgr.AcquireToken(Settings.ResourceUrlOfExchangeOnline);

            var api = new O365.OutlookCalendarAPI(token);

            var result = api.SyncEventsAsync(new JObject {
                { "startDateTime", "2016-03-28T00:00:00Z" },
                { "endDateTime", "2016-04-01T00:00:00Z" }
            })
                         .Result;

            Console.WriteLine(result.ToString());
        }
        public override void Run()
        {
            var tmgr = new UserTokenManagement();

            var token = tmgr.AcquireToken(Settings.ResourceUrlOfExchangeOnline);

            var api = new O365.OutlookCalendarAPI(token);

            JObject body = new JObject
            {
                { "Subject", "Create from Office 365 API" },
                { "Start", new JObject {
                      { "DateTime", "2016-03-24T15:00:00" }, { "TimeZone", "China Standard Time" }
                  } },
                { "End", new JObject {
                      { "DateTime", "2016-03-24T16:00:00" }, { "TimeZone", "China Standard Time" }
                  } }
            };

            var text = body.ToString();

            var result = api.CreateEventAsync(body).Result;
        }