Notion कनेक्टर
content-driven marketing workflows, CRM database synchronization, और स्वचालित notifications के लिए अपने Notion workspace को Tajo के माध्यम से Brevo से कनेक्ट करें।
अवलोकन
| Property | Value |
|---|---|
| Platform | Notion |
| Category | Custom |
| Setup Complexity | Easy |
| Official Integration | No |
| Data Synced | Databases, Pages, Users |
| API Type | REST API |
| Authentication | Internal Integration Token / OAuth 2.0 |
| Base URL | https://api.notion.com |
| API Version | 2022-06-28 (via Notion-Version header) |
विशेषताएं
- Database sync - Notion database entries को Brevo contacts और lists से sync करें
- CRM bridge - Notion databases को एक lightweight CRM के रूप में उपयोग करें, Brevo से synced
- Content notifications - जब Notion pages publish हों तो Brevo campaigns trigger करें
- Property mapping - Notion database properties को Brevo contact attributes से map करें
- Page monitoring - page updates ट्रैक करें और Brevo events के रूप में forward करें
- User directory sync - Notion workspace members को Brevo contacts से sync करें
पूर्वावश्यकताएं
शुरू करने से पहले, सुनिश्चित करें कि आपके पास हैं:
- admin access वाला एक Notion workspace
- एक Notion internal integration या OAuth app
- integration के साथ shared database pages
- API access वाला एक Brevo account
- सक्रिय subscription वाला एक Tajo account
प्रमाणीकरण
Notion दो authentication methods को support करता है।
विकल्प 1: Internal Integration (single workspace के लिए अनुशंसित)
- notion.so/my-integrations पर जाएं
- New integration पर क्लिक करें
- इसे “Tajo Integration” नाम दें
- अपना workspace चुनें
- capabilities सेट करें:
Content Capabilities: Read content: ✓ Update content: ✓ Insert content: ✓
User Capabilities: Read user information: ✓- Internal Integration Secret कॉपी करें (
ntn_से शुरू होता है)
Page Sharing आवश्यक
Internal integrations केवल उन्हीं pages और databases तक पहुंच सकते हैं जो स्पष्ट रूप से उनके साथ share किए गए हैं। ”…” menu > “Connections” > अपना integration चुनें के माध्यम से प्रत्येक target database को अपने integration के साथ share करें।
विकल्प 2: OAuth 2.0 (Public integrations)
कई workspaces की सेवा करने वाले integrations के लिए, OAuth 2.0 flow का उपयोग करें:
- अपने integration को public integration के रूप में register करें
- users को redirect करें:
https://api.notion.com/v1/oauth/authorize?client_id=... /v1/oauth/tokenपर access token के लिए code exchange करें
Tajo से कनेक्ट करना
tajo connectors install notion \ --token $NOTION_TOKENकॉन्फ़िगरेशन
बेसिक सेटअप
connectors: notion: enabled: true api_version: "2022-06-28"
sync: databases: true pages: false users: true
databases: - id: "abc123def456" name: "Customers" sync_to_list: 25 - id: "ghi789jkl012" name: "Leads" sync_to_list: 26Field Mapping
Notion database properties को Brevo contact attributes से map करें:
field_mapping: # Notion property -> Brevo attribute Name: type: title target: FIRSTNAME Email: type: email target: email Phone: type: phone_number target: SMS Company: type: rich_text target: COMPANY Status: type: select target: LEAD_STATUS Deal Value: type: number target: DEAL_VALUE Last Contact: type: date target: LAST_CONTACT_DATE Tags: type: multi_select target: TAGSAPI Endpoints
Tajo निम्नलिखित Notion API endpoints के साथ integrate करता है:
| Endpoint | Method | उद्देश्य |
|---|---|---|
/v1/databases/{id}/query | POST | database entries क्वेरी करें |
/v1/databases/{id} | GET | database schema पुनः प्राप्त करें |
/v1/pages | POST | एक नया page बनाएं |
/v1/pages/{id} | GET | page properties पुनः प्राप्त करें |
/v1/pages/{id} | PATCH | page properties अपडेट करें |
/v1/blocks/{id}/children | GET | block children पुनः प्राप्त करें |
/v1/users | GET | सभी workspace users list करें |
/v1/users/{id} | GET | एक user पुनः प्राप्त करें |
/v1/search | POST | पूरे workspace में खोजें |
कोड उदाहरण
कनेक्टर शुरू करें
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
await tajo.connectors.connect('notion', { token: process.env.NOTION_TOKEN});Database को Brevo से Sync करें
// Notion database को Brevo list से sync करेंawait tajo.connectors.sync('notion', { type: 'full', resources: ['databases'], databaseId: 'abc123def456', targetList: 25});
const status = await tajo.connectors.status('notion');console.log(status);// {// connected: true,// lastSync: '2024-03-15T14:30:00Z',// databasesSynced: 2,// pagesTracked: 1450,// usersCount: 32// }Query और Filter
// filters के साथ Notion database क्वेरी करेंconst results = await tajo.connectors.query('notion', { databaseId: 'abc123def456', filter: { property: 'Status', select: { equals: 'Active' } }, sorts: [ { property: 'Last Contact', direction: 'descending' } ]});Brevo Event से Page बनाएं
// जब Brevo contact किसी milestone पर पहुंचे तो Notion page बनाएंtajo.events.on('contact.attribute_updated', async (event) => { if (event.attribute === 'LIFECYCLE_STAGE' && event.value === 'customer') { await tajo.connectors.create('notion', { databaseId: 'ghi789jkl012', properties: { Name: { title: [{ text: { content: event.contact.name } }] }, Email: { email: event.contact.email }, 'Converted Date': { date: { start: new Date().toISOString() } } } }); }});Rate Limits
Notion प्रति integration rate limits लागू करता है:
| Limit Type | Value |
|---|---|
| Rate limit | प्रति integration 3 requests प्रति सेकंड |
| Burst limit | छोटे bursts की अनुमति, फिर throttled |
| Page size | प्रति paginated request अधिकतम 100 items |
Cursor-आधारित Pagination
Notion cursor-आधारित pagination का उपयोग करता है। Tajo इसे स्वचालित रूप से संभालता है, has_more के false लौटने तक next_cursor parameter का उपयोग करके सभी pages के माध्यम से iterate करता है।
जब rate limits पार हो जाते हैं तो Notion 429 Too Many Requests लौटाता है, Retry-After header के साथ।
समस्या निवारण
सामान्य समस्याएं
| समस्या | कारण | समाधान |
|---|---|---|
| 401 Unauthorized | अमान्य या expired token | integration token पुनः generate करें |
| 403 Forbidden | Page integration के साथ share नहीं | Connections के माध्यम से page/database को integration के साथ share करें |
| 404 Object not found | Database ID गलत या share नहीं | database ID और sharing settings सत्यापित करें |
| Properties गायब | Schema mismatch | database schema पुनः sync करें और field mapping अपडेट करें |
| Rate limit exceeded | बहुत अधिक rapid requests | sync frequency या batch size कम करें |
Debug Mode
connectors: notion: debug: true log_level: verbose log_api_calls: trueConnection Test करें
tajo connectors test notion# ✓ API authentication successful# ✓ Database access verified# ✓ User list accessible# ✓ Search operational# ✓ Page creation availableसर्वोत्तम प्रथाएं
- Databases को स्पष्ट रूप से share करें - Internal integrations केवल shared content देखते हैं
- Search के बजाय database queries का उपयोग करें - ज्ञात databases के लिए Queries तेज और अधिक विश्वसनीय होती हैं
- Property types को सावधानी से map करें - Notion में कई property types हैं; उन्हें Brevo attribute types से match करें
- Pagination संभालें - पूर्ण data के लिए हमेशा सभी cursor pages के माध्यम से iterate करें
- Incrementally sync करें - केवल बदली गई entries sync करने के लिए
last_edited_timefilters का उपयोग करें - Polling schedule सेट करें - Notion natively webhooks को support नहीं करता; नियमित अंतराल पर poll करें
सुरक्षा
- Bearer Token Authentication - Integration secrets और OAuth tokens
- HTTPS Only - सभी API communication TLS 1.2+ के माध्यम से encrypted
- Scoped Access - Integrations केवल explicitly shared content तक पहुंचते हैं
- OAuth 2.0 - public integrations के लिए सुरक्षित authorization flow
- Encrypted Storage - Tokens Tajo में at rest encrypted
- Workspace Isolation - प्रत्येक integration एक single workspace तक scoped है