Calendly-connector
Verbind Calendly met Brevo via Tajo om meeting-invitees automatisch te synchroniseren als contacten, e-mailreeksen te triggeren op basis van boekingsevents en je sales- en onboardingworkflows te stroomlijnen.
Overzicht
| Eigenschap | Waarde |
|---|---|
| Platform | Calendly |
| Categorie | Scheduling (Custom) |
| Setupcomplexiteit | Eenvoudig |
| Officiële integratie | Nee |
| Gesynchroniseerde data | Events, Contacten, Boekingen, Annuleringen |
| Auth-methode | OAuth 2.0 / Personal Access Token |
Functies
- Invitee-sync - Maak automatisch Brevo-contacten aan op basis van meeting-invitees
- Boeking-triggers - Start Brevo-automatiseringen wanneer meetings worden geboekt
- Annuleringsafhandeling - Trigger re-engagement-flows bij annuleringen
- No-show-detectie - Werk contactstatus bij wanneer invitees meetings missen
- Event type-mapping - Map verschillende Calendly-eventtypes naar Brevo-lijsten
- Scheduling API - Bouw scheduling rechtstreeks in je app zonder redirects
Vereisten
Voordat je begint, zorg dat je beschikt over:
- Een Calendly-account (Professional-plan of hoger voor API-toegang)
- Een Personal Access Token via Calendly Integrations
- Een Brevo-account met API-toegang
- Een Tajo-account met connector-rechten
Authenticatie
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' })});Configuratie
Basisinstelling
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}"Veldmapping
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 | Method | Beschrijving |
|---|---|---|
https://api.calendly.com/users/me | GET | Haal huidige gebruiker op |
https://api.calendly.com/event_types | GET | Lijst eventtypes |
https://api.calendly.com/scheduled_events | GET | Lijst geplande events |
https://api.calendly.com/scheduled_events/{uuid} | GET | Haal een gepland event op |
https://api.calendly.com/scheduled_events/{uuid}/invitees | GET | Lijst invitees |
https://api.calendly.com/scheduling_links | POST | Maak scheduling link |
https://api.calendly.com/webhook_subscriptions | POST | Maak een webhook |
https://api.calendly.com/webhook_subscriptions | GET | Lijst webhooks |
https://api.calendly.com/invitee_no_shows/{uuid} | GET | Haal no-show-status op |
Codevoorbeelden
Connector initialiseren
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});Geplande events opvragen
// 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();Invitees synchroniseren naar 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] });}Webhook-subscriptions opzetten
// 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 }) });Webhook-events afhandelen
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
| Resource | Limiet | Opmerkingen |
|---|---|---|
| API-requests | 6.000/min | Organisatiebrede limiet |
| Webhook-subscriptions | 30 per organisatie | Over alle eventtypes |
| Scheduling-links | Onbeperkt | Geen limiet per minuut |
Paginering
Calendly API-responses gebruiken cursor-gebaseerde paginering. Gebruik de next_page_token uit het pagination-object om extra resultaten op te halen. De default pagegrootte is 20 items, met een maximum van 100.
Probleemoplossing
| Probleem | Oorzaak | Oplossing |
|---|---|---|
| Webhook niet ontvangen | Verkeerde scope | Gebruik organization-scope voor webhooks |
| 401 Unauthorized | Token verlopen | Genereer een nieuw token of ververs het OAuth-token |
| Ontbrekende invitee-data | Vragen niet geconfigureerd | Voeg custom vragen toe aan het eventtype |
| Dubbele contacten | Geen dedup-logica | Gebruik e-mail als unieke identifier voor upserts |
| Rate limit 429 | Te veel requests | Implementeer backoff en batch je requests |
Debugmodus
connectors: calendly: debug: true log_level: verbose log_webhooks: trueBest practices
- Gebruik webhooks - Abonneer op
invitee.createdeninvitee.canceledvoor realtime sync - Voeg custom vragen toe - Verzamel bedrijf-, functie- en telefoongegevens voor rijkere contactprofielen
- Map eventtypes - Wijs per Calendly-eventtype verschillende Brevo-lijsten toe
- Handel no-shows af - Track no-shows om lead scoring en follow-up-reeksen aan te passen
- Gebruik scheduling-links - Genereer unieke scheduling-links voor gepersonaliseerde boekingservaringen
- Zet organisatie-scope - Gebruik org-level-webhooks om events van alle teamleden vast te leggen
Beveiliging
- OAuth 2.0 - Scoped token-gebaseerde authenticatie
- Webhook-signatures - HMAC-signature-validatie voor inkomende webhooks
- Alleen HTTPS - Alle API-endpoints vereisen TLS-encryptie
- Token-verloop - OAuth-tokens verlopen en vereisen refresh-flows
- Minimale scopes - Vraag alleen benodigde OAuth-scopes aan
- Veilige opslag - Sla tokens op in omgevingsvariabelen of secret managers