วิธีใช้ Google Gmail API - Sample code
(kibua20.tistory.com)นี่คือคำอธิบายเกี่ยวกับวิธีใช้ Gmail REST API และ OAuth 2.0 ของ Google โดยทำเป็น Web server application และมีโค้ดตัวอย่าง Python พร้อมคำอธิบายอย่างละเอียดในแต่ละขั้นตอน
Step 1: เปิดใช้งาน Gmail API และสร้าง Client ใน Google API Console
-
สร้าง Project
-
เปิดใช้งาน API library
-
ตั้งค่าหน้าจอขอความยินยอม OAuth
-
กำหนดค่าข้อมูลรับรองผู้ใช้
-
ตรวจสอบผลลัพธ์ OAuth Client ID
Step 2. รับ Authorization code จากเซิร์ฟเวอร์ยืนยันตัวตนของ Google
-
ส่งคำขอยืนยันตัวตนไปยังเซิร์ฟเวอร์ Google
-
ตั้งค่า Redirect URL
Step 3. ใช้ค่า Authorization code เพื่อรับ Access token
Step 4. ใช้งาน Gmail API: ตรวจสอบคำสั่ง curl และเขียนโค้ด Python
ลิงก์) https://kibua20.tistory.com/70 (Step 1)
https://kibua20.tistory.com/80 (Step 2, Step 3)
https://kibua20.tistory.com/81 (Step 4)
ยังไม่มีความคิดเห็น