Google api應用入門

5,813 views

Published on

Published in: Technology, Business
0 Comments
11 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,813
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
65
Comments
0
Likes
11
Embeds 0
No embeds

No notes for slide

Google api應用入門

  1. 1. GOOGLE API應用入門 MiCloud Robin / Simon
  2. 2. ● 漫遊Google API ● Google的API工具 ○ API Console介紹 ○ API Explore介紹 ● 從認證開始 ○ OAuth2 ● Google API的使用 ○ 從Calendar API開始 ○ 玩玩Drive API ● 淺談進階的API操作 - Apps Script Outline
  3. 3. Why Here... Cloud Changes the Developer 曾幾何時... ● system and os ● network setup ● install what I need ● mail sdk ● sms bridge ● backup and archive ● socket protocol ● using versioning for develop ● ... 現在... ● cloud machine ● vpc and permission ● software preload ● email service ● sms service ● object storage ● restful protocal ● git supported deploy ● ...
  4. 4. So.... Familiar cloud to be your weapon... Focus Core Business to Earn Money...
  5. 5. 漫遊Google API - 從服務開始 SERVICE API
  6. 6. 漫遊Google API - 這堂課很難(上)...
  7. 7. Start Implements of API REST SDK Web Mobile Developers use non-standard language Developers use standard toolkits End users End users
  8. 8. API使用流程 - 讀懂怎麼用 Active Your API Read the Document Integrate Authenticate Request API Integrate
  9. 9. Learning Resources - https://developers.google.com/
  10. 10. Google API Console - Services API Name API On/Off Notes for limit Help page & documents
  11. 11. Google API Console - Access Control Access Control Project Info Project Setting ID info list
  12. 12. Google API Console - Reports Usage Report
  13. 13. After Turn ON API....
  14. 14. What is API... Condition Input Resource Output
  15. 15. Google API Explore
  16. 16. Google API Explore - Multi-Versions
  17. 17. Google API Explore - Auth Operation Scope
  18. 18. Google API Explore - Query
  19. 19. Google API Explore - REST & Results REST Request Sam ple Request Results
  20. 20. Google API Java Client https://code.google.com/p/google-api-java-client/wiki/APIs#oauth2
  21. 21. Google API .NET Client http://code.google.com/p/google-api-dotnet-client/wiki/APIs#Oauth2
  22. 22. Google API Node.js Client https://github.com/google/google-api-nodejs-client
  23. 23. Other Language Support
  24. 24. Authenticate with Oauth2.0
  25. 25. ● OAuth 2.0 ● OAuth 1.0 ● Hybrid protocol(OpenID + OAuth) ● OpenID Google Implemented Auth(s)
  26. 26. Oauth2 Client Login Flow Redirect URL to MiCloud
  27. 27. An Example - MiCloud Oauth Login 1 2 3
  28. 28. Service Owner在Google的設定
  29. 29. Oauth優點 ● 簡單:不管是 OAuth 服務提供者還是應用開發 者,都很容易於理解與使用 ● 安全:沒有涉及到使用者金鑰等資訊,更安全 更靈活 ● 開放:任何服務提供者都可以實現 OAuth,任 何軟體發展商都可以使用 OAuth
  30. 30. Use of Google API - Calendar & Drive
  31. 31. What Calendar API can do... Functions ● acl ● calanderList ● calendars ● events ● setting ● ...
  32. 32. Connect Calendar API
  33. 33. Select your Operation..
  34. 34. Read the request and result $ curl https://www.googleapis.com/calendar/v3/users/me/calendarList/mitac.com.tw_4gqp4u0bit7....o%40group. calendar.google.com -H "Authorization: Bearer ya29.AHES6ZSBtCsGQhpkmB....jcbOSY46jflrKKa4" { "kind": "calendar#calendarListEntry", "etag": ""hTTG_yZRNM6RHYgIq0uRTKezdKo/GXuSxc1o...Vkx1AgpzIOs"", "id": "mitac.com.tw_4gqp4u0b...ugl7mi54ho@group.calendar.google.com", "summary": "7C2 假表", "description": "請貼上自己的假nex: 姓名/事由", "timeZone": "Asia/Taipei", "colorId": "3", "backgroundColor": "#f83a22", "foregroundColor": "#000000", "selected": true, "accessRole": "owner" }
  35. 35. API Explore Response
  36. 36. About Drive Gapps + Space HTTP Server + Google APIs HTTP Access + Market ● OA應用服務 ● 資料儲存 ● 更多應用程式 ● Mobile應用 ● 全世界的展示平 台 ● Simple Web ● RESTful ● 更多客製化的應 用 ● Google服務結合
  37. 37. Chrome store integrate
  38. 38. Drive best integrate platform
  39. 39. Use Apps Script
  40. 40. 淺談一下Apps Script ● JavaScript like programming language ● Cloud IDE integrate to Drive ● Easy access to Google services ● Some container integrate ● Free! ● Robust!
  41. 41. Apps Scripts目前種類 ● Standalone Scripts ● Container-Bound Scripts ● Spreadsheet Custom Functions ● Web Apps ● Google Sites Gadgets ● Container Extensions
  42. 42. Create Your Apps Script
  43. 43. What can I do - Simple HTTP Monitor
  44. 44. Piece of Code
  45. 45. Save data to sheet and setting chart
  46. 46. Or - Using RESTful Piece of Code
  47. 47. Deploy & Publish
  48. 48. Testing in curl URL Pattern:https://script.google. com/macros/s/:id/exec Script ID
  49. 49. Testing in Ajax Code...
  50. 50. Apps Script可行的應用 ● 結合Drive應用,做排成、資料顯示、互動...等 ● 結合Github Page, Cloud CMS等軟體,這些純 靜態HTML的頁面也可以有動態的結合 ● 結合Mobile的應用,讓Apps Script當做Mobile 的Server端,資料庫資源部分則可以使用Apps Script呼叫RDB, NDB, BigQuery...等 ● 結合Chrome Extension的應用...
  51. 51. ● Oauth 2: http://oauth.net/2/ ● Oauth1&2差異: ○ http://www.cnblogs. com/lingyun1120/archive/2011/12/12/2284788.html ○ http://blog.sina.com.cn/s/blog_4c9ba28501015ux6. html ● Google API Console: https://code.google. com/apis/console ● Google API Explore: https://code.google. com/apis/explorer/ ● Apps Script Site: http://www.google.com/script/start/ ● Apps Script Docs: https://developers.google.com/apps- script/ Reference

×