Calendly Connector
Forbind Calendly med Brevo gennem Tajo for automatisk at synkronisere mødeinvitéer som kontakter, udløse e-mailsekvenser baseret på bookinghændelser og strømline dine salgs- og onboarding-workflows.
Oversigt
| Egenskab | Værdi |
|---|---|
| Platform | Calendly |
| Kategori | Planlægning (brugerdefineret) |
| Opsætningskompleksitet | Let |
| Officiel integration | Nej |
| Synkroniserede data | Hændelser, kontakter, bookinger, annulleringer |
| Autentifikationsmetode | OAuth 2.0 / Personal Access Token |
Funktioner
- Synkronisering af invitéer - Opret automatisk Brevo-kontakter fra mødeinvitéer
- Bookingtriggere - Udløs Brevo-automatiseringer, når møder bookes
- Håndtering af annulleringer - Udløs re-engagement-flows ved annulleringer
- Detektering af no-shows - Opdatér kontaktstatus, når invitéer udebliver fra møder
- Mapping af hændelsestyper - Kortlæg forskellige Calendly-hændelsestyper til Brevo-lister
- Scheduling API - Indbyg planlægning direkte i din app uden omdirigeringer
Forudsætninger
Før du begynder, skal du sikre dig, at du har:
- En Calendly-konto (Professional-plan eller derover for API-adgang)
- Et Personal Access Token fra Calendly Integrations
- En Brevo-konto med API-adgang
- En Tajo-konto med connector-tilladelser
Autentifikation
Personal Access Token
# Generate at https://calendly.com/integrations/api_webhooksexport CALENDLY_ACCESS_TOKEN=your_personal_access_tokenexport TAJO_API_KEY=your_tajo_api_keyexport BREVO_API_KEY=your_brevo_api_keyOAuth 2.0
// OAuth 2.0 Authorization Code Flowconst authUrl = 'https://auth.calendly.com/oauth/authorize?' + new URLSearchParams({ client_id: process.env.CALENDLY_CLIENT_ID, redirect_uri: 'https://your-app.com/callback', response_type: 'code' });
// Exchange code for tokenconst tokenResponse = await fetch('https://auth.calendly.com/oauth/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'authorization_code', code: authorizationCode, client_id: process.env.CALENDLY_CLIENT_ID, client_secret: process.env.CALENDLY_CLIENT_SECRET, redirect_uri: 'https://your-app.com/callback' })});Konfiguration
Grundlæggende opsætning
connectors: calendly: enabled: true access_token: "${CALENDLY_ACCESS_TOKEN}"
sync: contacts: true events: true cancellations: true
event_mapping: discovery_call: list_id: 10 event_type_uri: "https://api.calendly.com/event_types/abc123" demo: list_id: 11 event_type_uri: "https://api.calendly.com/event_types/xyz789"
webhook: signing_key: "${CALENDLY_WEBHOOK_SIGNING_KEY}"Feltmapping
field_mapping: email: email name: FIRSTNAME questions_and_answers: company: COMPANY role: JOB_TITLE phone: SMS event_type_name: CALENDLY_EVENT_TYPE scheduled_at: MEETING_DATE status: BOOKING_STATUSAPI-endpoints
| Endpoint | Metode | Beskrivelse |
|---|---|---|
https://api.calendly.com/users/me | GET | Hent aktuel bruger |
https://api.calendly.com/event_types | GET | Vis hændelsestyper |
https://api.calendly.com/scheduled_events | GET | Vis planlagte hændelser |
https://api.calendly.com/scheduled_events/{uuid} | GET | Hent en planlagt hændelse |
https://api.calendly.com/scheduled_events/{uuid}/invitees | GET | Vis invitéer |
https://api.calendly.com/scheduling_links | POST | Opret planlægningslink |
https://api.calendly.com/webhook_subscriptions | POST | Opret webhook |
https://api.calendly.com/webhook_subscriptions | GET | Vis webhooks |
https://api.calendly.com/invitee_no_shows/{uuid} | GET | Hent no-show-status |
Kodeeksempler
Initialisér connector
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('calendly', { accessToken: process.env.CALENDLY_ACCESS_TOKEN});Vis planlagte hændelser
// Retrieve scheduled eventsconst response = await fetch( 'https://api.calendly.com/scheduled_events?' + new URLSearchParams({ user: 'https://api.calendly.com/users/YOUR_USER_ID', min_start_time: '2024-01-01T00:00:00Z', max_start_time: '2024-12-31T23:59:59Z', status: 'active', count: 100 }), { headers: { 'Authorization': `Bearer ${process.env.CALENDLY_ACCESS_TOKEN}`, 'Content-Type': 'application/json' } });
const events = await response.json();Synkronisér invitéer til Brevo
// Get invitees for a scheduled event and sync to Brevoconst inviteesResponse = await fetch( `https://api.calendly.com/scheduled_events/${eventUuid}/invitees`, { headers: { 'Authorization': `Bearer ${process.env.CALENDLY_ACCESS_TOKEN}` } });
const { collection } = await inviteesResponse.json();
for (const invitee of collection) { await tajo.contacts.sync({ email: invitee.email, attributes: { FIRSTNAME: invitee.name, CALENDLY_EVENT_TYPE: invitee.event, MEETING_DATE: invitee.created_at, BOOKING_STATUS: invitee.status }, listIds: [10] });}Opsæt webhook-abonnementer
// Subscribe to Calendly eventsconst webhook = await fetch( 'https://api.calendly.com/webhook_subscriptions', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.CALENDLY_ACCESS_TOKEN}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ url: 'https://api.tajo.io/webhooks/calendly', events: [ 'invitee.created', 'invitee.canceled', 'invitee_no_show.created' ], organization: 'https://api.calendly.com/organizations/YOUR_ORG_ID', scope: 'organization', signing_key: process.env.CALENDLY_WEBHOOK_SIGNING_KEY }) });Håndtér webhook-hændelser
app.post('/webhooks/calendly', async (req, res) => { // Verify webhook signature const signature = req.headers['calendly-webhook-signature']; const isValid = verifyCalendlySignature( req.rawBody, signature, process.env.CALENDLY_WEBHOOK_SIGNING_KEY );
if (!isValid) return res.status(401).send('Unauthorized');
const { event, payload } = req.body;
switch (event) { case 'invitee.created': await tajo.contacts.sync({ email: payload.email, attributes: { BOOKING_STATUS: 'booked' }, listIds: [10] }); break; case 'invitee.canceled': await tajo.contacts.update(payload.email, { attributes: { BOOKING_STATUS: 'cancelled' } }); break; case 'invitee_no_show.created': await tajo.contacts.update(payload.email, { attributes: { BOOKING_STATUS: 'no_show' } }); break; }
res.status(200).send('OK');});Rate limits
| Ressource | Grænse | Noter |
|---|---|---|
| API-anmodninger | 6.000/min. | Organisationsdækkende grænse |
| Webhook-abonnementer | 30 pr. organisation | På tværs af alle hændelsestyper |
| Planlægningslinks | Ubegrænset | Ingen grænse pr. minut |
Paginering
Calendly API-svar bruger cursor-baseret paginering. Brug next_page_token fra pagination-objektet til at hente yderligere resultater. Standardsidestørrelsen er 20 elementer, med maksimalt 100.
Fejlfinding
| Problem | Årsag | Løsning |
|---|---|---|
| Webhook ikke modtaget | Forkert scope | Brug organization-scope til webhooks |
| 401 Unauthorized | Token udløbet | Generér nyt token eller opdatér OAuth-token |
| Manglende invitéedata | Spørgsmål ikke konfigureret | Tilføj brugerdefinerede spørgsmål til hændelsestypen |
| Duplikerede kontakter | Ingen dedup-logik | Brug e-mail som unik identifikator til upserts |
| Rate limit 429 | For mange anmodninger | Implementér backoff og batch-anmodninger |
Debug-tilstand
connectors: calendly: debug: true log_level: verbose log_webhooks: trueBedste praksis
- Brug webhooks - Abonnér på
invitee.createdoginvitee.canceledtil synkronisering i realtid - Tilføj brugerdefinerede spørgsmål - Indsaml virksomheds-, rolle- og telefondata for rigere kontaktprofiler
- Kortlæg hændelsestyper - Tildel forskellige Brevo-lister pr. Calendly-hændelsestype
- Håndtér no-shows - Spor no-shows for at justere lead-scoring og opfølgningssekvenser
- Brug planlægningslinks - Generér unikke planlægningslinks for personaliserede bookingoplevelser
- Angiv organisations-scope - Brug webhooks på org-niveau for at fange hændelser fra alle teammedlemmer
Sikkerhed
- OAuth 2.0 - Scopes token-baseret autentifikation
- Webhook-signaturer - HMAC-signaturvalidering til indgående webhooks
- Kun HTTPS - Alle API-endpoints kræver TLS-kryptering
- Token-udløb - OAuth-tokens udløber og kræver refresh-flows
- Minimale scopes - Anmod kun om de nødvendige OAuth-scopes
- Sikker opbevaring - Gem tokens i miljøvariabler eller secret-managere