【Google Calendar API v3】get events list with OAuth 2.0 &
It took me some time to learn about the Google Calendar API V3 and I have encountered some problems. So it is necessary to summary the steps, just take the 'event list' as an example. The event list API is here:https://developers.google.co
It took me some time to learn about the Google Calendar API V3 and I have encountered some problems. So it is necessary to summary the steps, just take the 'event list' as an example.
The event list API is here: https://developers.google.com/google-apps/calendar/v3/reference/events/list
Details of using OAuth 2.0 for Login is here: https://developers.google.com/accounts/docs/OAuth2Login
Assumption: you have alreay registered your app and turn the Calendar API 'ON' in the 'API & auth' sidebar.
Note: The request needs authorization and I use OAuth 2.0, here are the steps.
Step 1. Send an Authentication Request to Google
HTTP GET: https://accounts.google.com/o/oauth2/auth?
client_id=XXXXXXXXX&
response_type=code&
scope=https://www.googleapis.com/auth/calendar&
redirect_uri=XXXXXXXXX&
login_hint=XXXXXX
client_id: can be seen in your Google Cloud Console.
redirect_uri: also in your Google Cloud Console, you must write it down in your registered apps page.
login_hint=google account
Then your will find the code parameter in the redirect uri.
Step 2. Exchange Code for Access Token and ID Token
Use the code you got in the last step to post request. The actual request might look like:
<span>POST /o/oauth2/token HTTP/1.1 Host: accounts.google.com Content-Type: application/x-www-form-urlencoded code=4/P7q7W91a-oMsCeLvIaQm6bTrgtp7& client_id=8819981768.apps.googleusercontent.com& client_secret={client_secret}& redirect_uri=https://oauth2-login-demo.appspot.com/code& grant_type=authorization_code</span>
I use the Chrome Plugin Rest Client to post the request and get access token.
Then you will get the access_token in the response.
Step 3. Get Events List NOW!
With the access_token, you are able to request the event list according to Google Calendar API.The whole HTTP GET URI is like:
https://www.googleapis.com/calendar/v3/calendars/{your calendar id}/events?
code=XXXXXX&
client_id=XXXXXX&
client_secret=XXXXXX&
redirect_uri=XXXXX&
grant_type=authorization_code
&access_token=XXXXXXXX
{your calendar id} is your google account, looks like XXX@gmail.com
Then you will get the JSON response!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

Google在 Pixel 8 系列中引入了 DisplayPort 替代模式,並且在新推出的 Pixel 9 系列中也採用了該模式。雖然它主要是為了讓您透過連接的螢幕鏡像智慧型手機顯示,但您也可以將其用於桌面

目前,四款新 Pixel 智慧型手機預計將於今年秋季上市。回顧一下,據傳該系列將在發佈時推出 Pixel 9 和 Pixel 9 Pro。然而,Pixel 9 Pro 將成為 iPhone 16 Pro 的競爭對手,而不是 Pixel 8 Pro(目前)

從 Gemini 1.5 Pro 大語言模型 (LLM) 開始,Google AI 已開始為開發人員提供擴展上下文視窗和節省成本的功能。以前可透過等候名單獲得完整的 200 萬個代幣上下文窗口

谷歌最近回應了有關 Pixel 9 系列 Tensor G4 性能的擔憂。該公司表示,該 SoC 的設計初衷並不是為了超越基準。相反,該團隊專注於使其在 Google 想要的領域中表現良好。

Google's AI assistant, Gemini, is set to become even more capable, if the APK teardown of the latest update (v15.29.34.29 beta) is to be considered. The tech behemoth's new AI assistant could reportedly get several new extensions. These extensions wi

Pixel 9 系列即將上市,原定於 8 月 13 日發布。根據最近的傳言,Pixel 9、Pixel 9 Pro 和 Pixel 9 Pro XL 將與 Pixel 8 和 Pixel 8 Pro(亞馬遜售價 749 美元)一樣,配備 128 GB 儲存空間。

谷歌距離全面展示新硬體還有大約兩週的時間。像往常一樣,無數消息來源洩露了有關新 Pixel 設備的詳細信息,無論是 Pixel Watch 3、Pixel Buds Pro 2 還是 Pixel 9 智慧型手機。看來公司也

更多與 Pixel 9 系列相關的宣傳資料已在網路上洩漏。作為參考,在 91mobiles 分享多張圖片後不久,新的洩漏事件也出現了,其中還展示了 Pixel Buds Pro 2 和 Pixel Watch 3 或 Pixel Watch 3 XL。這次
