Google Drive ও Google Docs Integration

লেসন ১১ / ২৫

Google Drive Operations

ফাইল আপলোড করা

Node: Google Drive
Operation: Upload
File Name: report_{{ $now.toFormat("yyyy-MM-dd") }}.pdf
Folder: Reports/2025/
Binary Property: data   (আগের node থেকে আসা file)

ফাইল/ফোল্ডার তালিকা দেখা

Operation: Get Many Files
Folder: Shared/Invoices/
Query: name contains "invoice" and mimeType = "application/pdf"
Limit: 100

ফাইল ডাউনলোড করা

Operation: Download
File ID: {{ $json.fileId }}
→ Binary data হিসেবে পাওয়া যাবে
→ পরের node-এ Gmail attachment হিসেবে দেওয়া যাবে

Shared Link তৈরি করা

Operation: Share
File ID: {{ $json.fileId }}
Permission:
  Role: reader
  Type: anyone
→ Response-এ public URL পাওয়া যাবে

Google Docs থেকে টেক্সট পড়া

Node: Google Docs
Operation: Get
Document URL/ID: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms

Response: { "body": { "content": [...] } }
→ Text extract করতে Code node ব্যবহার করুন

Template Doc থেকে নতুন Document তৈরি

[Google Drive — Template কপি করা]
  Operation: Copy
  File ID: template_doc_id
  Name: Invoice_{{ $json.clientName }}_{{ $today }}
         ↓
[HTTP Request — Docs API দিয়ে placeholder replace]
  POST: https://docs.googleapis.com/v1/documents/{id}:batchUpdate
  Body: { replace "{{CLIENT_NAME}}" with $json.clientName }
         ↓
[Google Drive — Share করা ও link নেওয়া]
         ↓
[Gmail — client-কে link পাঠানো]