 Hello, everyone. My name is Sean and I'm a Program Manager on the Office team at Microsoft. Thank you so much for joining me today on this video and I'm very, very excited to show you the public preview of the Office 365 Tasks API. Today, I'm going to break down the session into two main parts. I'll spend the first half of the session giving you an introductory overview of the Tasks API. After that, we'll jump straight into a simple demo of interacting with the Tasks API using a lightweight Node.js app that I built for the session. So, without further ado, let me jump straight into the presentation. So in all things that we do in Office and Microsoft, we always ask the question of, why? Why are we doing this? And the reason is pretty obvious and compelling. Today, in Office 365, you can already programmatically access a user or a group's resources through the Microsoft Graph. These resources include files, conversations, events, and many others. But there are no tasks. In the many things that people do at work and when they collaborate, tasks are at the center of all things. Therefore, we want to ensure that this missing piece in the jigsaw is not made available to you. We're here to make sure that you are solving your customers' problems with great solutions. So when we were thinking about building the Tasks API, we thought deeply about what scenarios and solutions our developers may want to build. It turns out that there are indeed a wide variety of scenarios and apps for which developers can leverage a Tasks API. What you see on my right are some examples, and they range from helping users capture work and tasks in the more context of what they're doing to automating an existing workflow that involves tasks to integrating it within popular team applications and more. And with a platform-agnostic REST interface, your solutions could be realized in all different forms, be it web services, native clients, or Office add-ins. Just think about what you can build with Excel add-in app model and the Tasks API, for example. Now, the best example of an application fully leveraging the Tasks API and the larger Microsoft Graph is the recently announced Office 365 Planner. Planners are all new experience that we shipped from the project team. It offers people a simple and highly visual way to organize teamwork. Planner makes it really easy for your team to create new plans and groups, organize and assign tasks, share files and links, chat about what you're working on, and collaborate with other team members. It is at the center of work for a team. And you know what? It is completely built on top of the Tasks API and the Microsoft Graph. So without looking at something like the API schema reference, Office 365 Planner should already give you some idea about what you can do with Tasks in relation to other entities in Office 365. But now, let's delve a little deeper into the Tasks API itself. First and foremost, it is worth pointing out that the Tasks API will only be available through the Microsoft Graph or what was formerly known as the Office 365 Unified API. In other words, when you read and write Tasks to the Tasks API, you will be sending HTTP requests to the graph.microsoft.com domain as opposed to the Planner domain. If you are a seasoned Office 365 developer, this might be a little different from what you're used to since you might have built many different applications related to mail, calendar and files that leverage calling the APIs on exchange or SharePoint domains. For us, we don't have any plans to expose the Tasks API at our own domain because we strongly believe in the unified endpoint strategy because developers like you will have life a lot easier. At the same time, just like the other Office 365 REST APIs, the Tasks API follows the old data V4 specifications and supports authorization through OAuth 2.0 industry standard. And like I've always mentioned before, it is a RESTful API where you only have to deal with HTTP verbs like get, post, patch and delete. Now, if you heard me mention groups, plans and Tasks during my presentation so far, let's take a closer look at how these main entities amongst the other entities in Tasks API relate to each other. It's a very straightforward relationship actually. Groups are the owners of plans. Today, a group can own no more than one plan. A plan contains a collection of Tasks and these Tasks can then be assigned to users, group into buckets and associated with files and others. If you were to take a look at the data structures of the plan object and the task object, the relationships that I have just talked about are well expressed on the object properties. As you can see on my right-hand side, the plan object has owner field. The value of this field will be the object ID of a group object. Similarly, on the task object, there's a plan ID field that corresponds to the ID field of the plan to which it belongs. It is extremely easy to navigate the main entities and retrieve entity collections. Some of the most common paths are shown on my right-hand side. With a group ID, it just takes you two calls to navigate and retrieve a collection of Tasks. Isn't that great? Now, you must be getting really bored watching me talk about the Tasks API. So let's instead get hints on interacting with the API to see it working in real life. Before I do that, the setup of the demo is pretty straightforward here. Basically, we have a super lightweight web application that will talk to the Microsoft Graph API to retrieve plans and tasks for a user's group. From the user's perspective, it's gonna start with a consent flow through Azure AD, which allows our application to acquire access token for Microsoft Graph. The application will then use the access token to retrieve data from the graph and return a view in the browser to the user. We'll also be able to create a task from that view. All right, let's now switch our screens then. All right, so I'll just quickly show you how this app will eventually work on localhost. So this is a Node.js app. I will use a Node.js command prompt. I'm gonna do npm start to run the application. Now it's running. Let's open up the browser in Microsoft Edge. Let's do HTTP localhost 3000. All right, there you go. This is a page where they're asking you to log in through AAD. So we're gonna click here and it's gonna take me to the AAD login page. I'm gonna put in an account. And what you see here is the plan to which plan owned by the group. And then there's a link to the tasks. If I click on that, this takes you to all the tasks in that plan and the results come from doing a get to slash plan slash ID slash tasks. You can see there's a bunch of tasks in here. And this app allows you to add a new task to it. So I'm gonna click here. Look at the plan ID that's already been pre-populated. So I'm gonna say get coffee, for instance, even though it's not that related. Click add and now it takes me back to the tasks page and there you go. We have created the get coffee. So this is what we're gonna build today and now I will switch over to VS Code. As you can see, especially for those of you who are very familiar with Express.js, there's a nice basic project Scared Fold generated by the Express Generator. While the Scared Fold of MEC projects show a lot of files in here, the ones that we should be concerned with are pretty much in the routes folder right here. You can think of it as where the controller code is and specifically we're looking at the file called index.js. Today our goal will be to navigate from the users group to the users plan and into the tasks in that plan. We will also create a task in that plan as part of the process. So there are two main steps in the application flow. First of which is authentication authorization piece. And the second part of it is actually making the real rest calls. The former actually relies on using the ADAL node.js library. So as you can see here, if I scroll up, we're actually importing authentication contacts from ADAL node that we installed as part of the MPM package. And all of the variable declarations in here, they're either used for constructing the auth URL you see here or they actually use the initialized authentication contacts for actually acquiring the token, which is right here. And what we're doing here is actually using the authorization code grand flow. The second step will be actually making a series of calls. And that's where the code in this section shows. Basically what we're doing here is doing slash groups ID slash plans and that's going to return you the plans in a group. And just to remind you, I did mention the presentation that there's only a maximum one plan per group as of today. Similarly, to get the tasks in the plan, we'll use the ID provided in the URL and then do a query to Microsoft Graph by doing slash plans slash ID slash tasks. And that will actually return you with the collection of tasks in that plan. Lastly, if you remember my demo, would it have a form or a page where you can create tasks? And this is where the code lies. This part of it actually renders the page for you to actually put in the title that you want to create for the tasks. And then once that is done, the form actually does the form post to the create task endpoint of this Node.js application. And this Node.js application will actually construct its own JSON body, title and plan ID from the post body that's coming from the form and send this new body to slash tasks at Microsoft Graph. And that's how the task is actually being created. So it's really straightforward here and there's a lot more you can do to add on to all the controller code or you know, render better UI. But everything looks cool here. All right, this is a pretty straightforward piece of code and that should be able to help you get started interacting with the Task API and Microsoft Graph. All right, so that was a simple quick demo of how you work with the Task API end to end. So for those of you in the Office 365 first release program who already have access to it, please go register an app and try it out today. More people in the Office 365 first release program can also expect to get it in the coming weeks. In terms of general availability, we're targeting the first half of 2016. So definitely keep a lookout for that. With that, I wanna say a big thank you to everyone who's watching my session. I hope that this has been useful for you and that you are now as excited as I am about the Office 365 Task API. Goodbye.