用office 365和微软graph开发邮件应用 - microsoft · office 365 devdays 2017.11.4-6 |...

19
Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Upload: others

Post on 24-Jun-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Office 365 DevDays

2017.11.4-6 | 上海

用office 365和微软Graph开发邮件应用

徐金林 Jinlin Xu

Page 2: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

背景知识 Background

示范 Demonstration

学员尝试 Hands on practice

更多资源 More Resources

目 录CONTENTS

Page 3: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Graph之前的世界

Work and school Personal

Page 4: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

有了Graph的世界

SUBTITLE OF THIS ARTICLE SUBTITLE OF THIS ARTICLE

点击请替换文字内容 点击请替换文字内容Microsoft Graph

https://graph.microsoft.com/

Work and school Personal

Page 5: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Highlight API Example -FindMeetingTimes

{“attendees” :[{“address”: “[email protected]”},

{“address”: “[email protected]”},{“address”: “[email protected]”}],

“timeConstraint”:{ “timeslots”: [{“start”: “2017-04-17T09:00:00”},

{“end”: “2017-04-17T17:00:00}]},

“MeetingDuration”: “PT2H”,“MinimumAttendeePercentage”: “90”….

}

{“meetingTimeSuggestions”:

[{“confidence”: “100.0”},{“meetingTimeSlot”:

{“start”: “2017-04-17T11:00:00”},{“end”: “2017-04-17T13:00:00”}},

……}

How can you achieve this by using EWS?

如何通过使用 EWS 来实现此目的?

Page 6: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

背景知识 Background

示范 Demonstration

学员尝试 Hands on practice

更多资源 More Resources

目 录CONTENTS

Page 7: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

背景知识 Background

示范 Demonstration

学员尝试 Hands on practice

更多资源 More Resources

目 录CONTENTS

Page 8: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Prerequisites

• Overview of Microsoft Graph

• Register you app with the Azure ADRead

• Visual Studio Professional

• Any web server (IIS Express works)Install

• Office 365 accountHave

Page 9: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Outcomes

In Scope

✓Learn about graph API and how to use them

✓Set up an graph based mail app

✓Exercise graph APIs to implement some real mail scenarios

Out of Scope

Exchange EWS

Complex “Outlook”

Page 10: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Exercise Modules

Warm up - setup

Send a mail to Jinlin

Get your meeting list

Query your contacts

Advanced - Build an Android App

https://github.com/Shanghai2017/ -> mail-app-o365-graph -> exercises

Page 11: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Warm up - setup

Overview

• In this module you will set up the solution and run the first Graph API.

Open the workshop code base

• mail-app-o365-graph/workshop-code-base

Register your app

• https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2

Update the configuration. Set up the web site.

• Update the "client_id" and "redirect_uri". Set up the web site root path.

Page 12: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Warm up - setup

Overview

• In this module you will set up the solution and run the first Graph API.

Download the workshop code base

• https://github.com/Shanghai2017/mail-app-o365-graph/tree/master/workshop-code-base

Register your app

• https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2

Update the configuration. Set up the web site.

• Update the "client_id" and "redirect_uri". Set up the web site root path.

Run and see your mail list.

• Run modified code, login and see your mail list.

Page 13: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Send a mail to Jinlin

Overview

In this module you will send a mail to Jinlin

Read the API to send mail

• https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_sendmail

Implement send mail functions

• graph-mail.js

Send a mail to Jinlin

[email protected]

Page 14: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Get your meeting list

Overview

In this module you will get your meeting

Read the API to get meetings

• https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_events

Implement get meeting functions

• graph-meeting.js

Find your meetings

Page 15: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Query your contacts

Overview

In this module you will query your contacts in your address book

Read the API to get contacts

• https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_contacts

Implement get contact functions

• graph-contact.js

Query your contacts

Page 16: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Advanced: Build an Android App

Overview

In this module you will build your own android mail App

Download the Cordova code, replace the “www” folder

• https://github.com/Shanghai2017/mail-app-o365-graph/tree/master/more%20resources/Cordova

Register your mobile app

• https://developer.microsoft.com/en-us/graph/docs/concepts/auth_register_app_v2

Update the configuration for native client

• Update the “client_id”

Build the APK and try it on your phone

• http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html

Page 17: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

背景知识 Background

示范 Demonstration

学员尝试 Hands on practice

更多资源 More Resources

目 录CONTENTS

Page 18: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

更多资源

▪ https://developer.microsoft.com/en-us/graph

▪ http://stackoverflow.com/questions/tagged/microsoftgraph

▪Mail App with Graph and Office 365

Page 19: 用office 365和微软Graph开发邮件应用 - Microsoft · Office 365 DevDays 2017.11.4-6 | 上海 用office 365和微软Graph开发邮件应用 徐金林 Jinlin Xu

Office 365 DevDays

Thank you