対象èªè
- Googleã®ãµã¼ãã¹ãAPIã«èå³ã®ããæ¹ãæ©ãã ãã¨ãããæ¹
- Google Cloud Platformã«èå³ã®ããæ¹
- Googleã§ã¯ãªãAPIã®çµé¨ãããæ¹ï¼æ¨å¥¨ï¼
å¿ è¦ãªç°å¢
- Googleã¢ã«ã¦ã³ã
- Webãã©ã¦ã¶
- ãµã³ãã«ã³ã¼ããå®è¡ããå ´åã¯ãJavaã®éçºç°å¢
Google APIã®åºç¤ç¥è
ãGoogleãæä¾ãã大æµã®ãã©ãããã©ã¼ã ããµã¼ãã¹ã¯ããããã®ãªã½ã¼ã¹ã¸ã¢ã¯ã»ã¹ããããã®APIï¼ä»¥ä¸ãGoogle APIï¼ãæä¾ãã¦ãã¾ããã¾ãã¯ãGoogle APIãç解ããããã®åºç¤ã¨ãªãäºé ãæ¼ããã¦ããã¾ãããã
APIã¨ã®éä¿¡æ¹å¼ã¨Discovery Document
ãGoogle APIã¨éä¿¡ããæ¹å¼ã«ã¯æ¬¡ã®2ã¤ãããã¾ãã
- OAuth1ã§ã¢ã¯ã»ã¹è¨±å¯ãå¾ã¦ãATOMæ¸å¼ã§éä¿¡ãã
- OAuth2ã§ã¢ã¯ã»ã¹è¨±å¯ãå¾ã¦ãJSONæ¸å¼ã§httpsã使ã£ã¦éä¿¡ãã
ãåè ã¯å¤ãAPIã®éä¿¡æ¹å¼ã§ãå¾ã ã«å¾è ã«ç½®ãæãããã¦ãã¾ããæ°ãã«å ¬éãããAPIã¯å ¨ã¦å¾è ã«ãªã£ã¦ãã¾ããä»åç´¹ä»ããAPIãå¾è ã§ããã¨ãã¾ãã
ãå¾è ã®APIã¯Discovery based APIã¨å¼ã°ãã¾ããDiscovery based APIã®ä»æ§ã¯Discovery Documentã¨å¼ã°ããJSONææ¸ã§å®ç¾©ããã¦ããããã®ä»æ§ã«æºæ ãã¦ããAPIã®å¤§é¨åã¯ãGoogle APIs Discovery Serviceã¨ãããAPIãæ¢ãAPIãã使ã£ã¦æ¢ããã¨ãã§ãã¾ãã
ãã¾ããJSONææ¸ã§ããDiscovery Documentã¯ãããã°ã©ã ã§å¦çãããã¨ãã§ãã¾ãããããå©ç¨ãã¦ãDiscovery Documentã§å®ç¾©ããã¦ããAPIã使ç¨ããWebã¢ããªã±ã¼ã·ã§ã³ããèªåçã«çæãããã¨ãã§ãã¾ãã
ããã®ä»çµã¿ãå©ç¨ãããã¼ã«ã«Google API Explorerãããã¾ããGoogle API Explorerã¯ãGoogle APIs Discovery Serviceã使ã£ã¦APIãåå¾ããä¸è¦§è¡¨ç¤ºãã¦ããã¾ãããããã ãã«ã¨ã©ã¾ãã¾ãããä¸è¦§ã«ããAPIãç°¡åã«å®è¡ãã¦ã¿ããã¨ãå¯è½ã§ãã
ãAPI Explorerã¯ãå¤ãã®APIã®ãªãã¡ã¬ã³ã¹ã«ãåãè¾¼ã¾ãã¦ãã¾ãããããããªãã¡ã¬ã³ã¹ã®ç»é¢ã§ã¯ã説æããã¦ããAPIãå®è¡ãã¦ã¿ããã¨ãã§ãã¾ãã
ãDiscovery basedãªAPIã¯ãGoogleãæä¾ãã¦ãããã®ãå©ç¨ããã ãã§ã¯ãªããèªåã§ãå©ç¨ã§ãã¾ããGoogle Cloud Platformã®Cloud Endpointsã¨ããæ©è½ã使ãã°ãAPI Explorerã®ãããªã·ã³ãã«ãªã¯ã©ã¤ã¢ã³ãã¯ãã¡ãããWebã¢ããªã±ã¼ã·ã§ã³ã¨Androidã¨iOSåãã®ã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªãèªåçæãããã¨ãã§ãã¾ãã
APIã®ç¨®é¡
ãGoogleã®æ§ã ãªãã©ãããã©ã¼ã ããµã¼ãã¹ãAPIãæä¾ãã¦ãã¾ãããã©ã®æã¡ä¸»ã®ãªã½ã¼ã¹ãæä½ããããã¨ãã観ç¹ãã次ã®3ã¿ã¤ãã«åé¡ã§ãã¾ãã
Webãµã¼ãã¹åãã®API
ãæãä¸è¬çãªAPIã§ãGmailãGoogle DriveãGoogle Calendarãªã©ã®ãå人ã使ç¨ããWebãµã¼ãã¹ãã®ãªã½ã¼ã¹ã«å¯¾ããã¢ã¯ã»ã¹ãæä¾ããã¾ãã
ãä¾ãã°ãã¢ã¯ã»ã¹æ¨©éãåå¾ããã¦ã¼ã¶ã«å¯¾ããGmailã®ã¹ã¬ãããåå¾ããããã¹ã¬ããã«ã©ãã«ãã¤ããããCalendarã«äºå®ãä½ã£ããã¨ããããã«ãç¹å®ã®ã¦ã¼ã¶ãææãããªã½ã¼ã¹ãæä½ã§ãã¾ãã
ãã©ãããã©ã¼ã åãã®API
ãGoogle Cloud Platformãªã©ã§ä½¿ç¨ãããªã½ã¼ã¹ã«å¯¾ããã¢ã¯ã»ã¹ãæä¾ãããã®ã§ãDeveloper Consoleï¼å¾è¿°ï¼ã®ããã¸ã§ã¯ããææãããªã½ã¼ã¹ã«å¯¾ããã¢ã¯ã»ã¹ãæä¾ããã¾ãã
ãä¾ãã°ãããã¸ã§ã¯ãã§ä½¿ç¨ãã¦ããã¹ãã¬ã¼ã¸é åã«ãã¡ã¤ã«ãæ¸ãè¾¼ãã ããCompute Engineãªã©ã®ãªã½ã¼ã¹ã®ç¶æ
ãæä½ãããã§ãã¾ãã
Google Appsåãã®API
ãä¼æ¥åãã®ãããã¯ããã©ãããã©ã¼ã ã§ããGoogle Appsã®ãªã½ã¼ã¹ã«å¯¾ããã¢ã¯ã»ã¹ãæä¾ããã¾ãã
GmailãGoogle Calendarãªã©ã®çµç¹å
ã®ã¦ã¼ã¶ãææãããªã½ã¼ã¹ã¯ãã¡ãããçµç¹å
ã®ã¦ã¼ã¶ãã°ã«ã¼ããçµç¹æ
å ±ãªã©ã®çµç¹ãææãªã½ã¼ã¹ãæä½ã§ãã¾ãã
APIã§æä¾ãããæä½ã®å ±éæ§
ãGoogle APIã§æä¾ãããåãªã½ã¼ã¹ã«å¯¾ããæä½ã¯ãRESTã«ä¼¼ãã¡ã½ããã§æä¾ããã¦ãã¾ãã次ã®ç»é¢ã¯ãCalendar APIã®ãªãã¡ã¬ã³ã¹ã§ããå·¦å´ã®"API Reference"ãã"Events"ãé¸æããã¨ãlistãgetã¨ãã£ãã¡ã½ããã並ãã§ãããã¨ã確èªã§ãã¾ãã
ãã¾ããããããã¡ã½ããã«ã¯ãGoogle APIã®éã§ããªãå ±éæ§ãããã¾ããä¾ãã°ã次ã®è¡¨ã®ã¨ããã§ããlistãgetã¨ãã£ãã¡ã½ããã¯ãCalendar API以å¤ã«ãæä¾ããã¦ãã¾ãã
ã¡ã½ãã | æ©è½ |
---|---|
list | ä¸è¦§ãåå¾ãã |
get | IDãæå®ãã¦ãä¸ä»¶åå¾ãã |
insert | æ°è¦ä½æãã |
update | ä¸æ¸ããã |
patch | é¨åçã«ä¸æ¸ããã |
delete | æå®ããIDã«å¯¾å¿ãããã®ãåé¤ãã |
ãåãªã½ã¼ã¹ã«å¯¾ããæä½ã¯ããªã½ã¼ã¹å.ã¡ã½ããåãã¨ãã表ç¾ã§å®ç¾©ããã¦ãã¾ãã
ãã¾ãããããã®æä½ãè¤æ°ã¾ã¨ãã¦ä¸æ¬å®è¡ããæä½ãå¯è½ãªå ´åãããã¾ããããã¯batchãªã¯ã¨ã¹ãã¨å¼ã°ããè¤æ°ã®æä½ãé£ç¶ãã¦å®è¡ããå ´åã«ä½¿ãã¨å¹æçã§ããGoogle APIã®batchãªã¯ã¨ã¹ãã«ã¯OData batch processingã¨ããéä¿¡æ¹å¼ãæ¡ç¨ããã¦ãã¾ãã