Bitrix24 entegrasyonu
B2B Worker, Bitrix24 ile local webhook köprüsü üzerinden konuşur (marketplace/OAuth yok — MVP).
CRM materialize (contact/company/deal → b2bcrm Records) bu dokümanın konusu değildir.
Klinik CRM kayıtları için b2bcrm → Settings → Bitrix (/settings/bitrix) kullanın.
Ayrıntı: b2bcrmdocs/bitrix-inbound.md.
Bu panel yalnızca deal → event → workflow otomasyonu içindir.
Mimari
Bitrix24 app.b2bworker.com Bitrix24
| | |
| Outgoing webhook | |
| ONCRMDEAL* | |
| POST …/integrations/bitrix/hooks/{org}/ |
|------------------------------------->| token doğrula |
| | crm.deal.get (+ contact) |
| | field_map → payload |
| | ingest_event + workflow |
| | WhatsApp / partner … |
| |--------------------------------->|
| | WebhookSubscription |
| | EXECUTION_SUCCESS/FAILED |
| | POST …/bitrix/result/{org}/ |
| | crm.deal.update veya |
| | crm.automation.trigger |
Panel: /integrations/bitrix
Bitrix tarafında manuel adımlar
-
Incoming webhook (Geliştirici kaynakları → Incoming)
- CRM okuma/yazma + Automation yetkileri
- URL’den
user_idvecodealın → panele yapıştırın
-
Outgoing webhook
- Handler URL = paneldeki hooks_url
- Event:
ONCRMDEALADDve/veyaONCRMDEALUPDATE - Application Token → panele
-
Deal + Contact alanları
- Telefon Contact’ta; E.164 tercih (
+90…) - Custom: örn.
UF_CRM_AIRPORT,UF_CRM_FLIGHT_TIME - Field map ile B2B path’lerine bağlayın (
patient.phone, …)
- Telefon Contact’ta; E.164 tercih (
-
Huni / Automation (opsiyonel)
- Başarı/hata aşamaları
- “Track Incoming Webhook” trigger →
trigger_codepanele
-
Lisans
- On-premise outgoing için aktif lisans gerekir; demo’da çalışmayabilir
B2B panel adımları
- /integrations/bitrix — portal, incoming code, outgoing token
- Default
event+workflowkey (örn.FLIGHT_CHANGED/flight-change) - Field map satırları
- on_success / on_failure aksiyonu
- Aktif işaretle → Kaydet (otomatik
WebhookSubscriptionoluşur) - Deal ID ile Önizle
PUBLIC_APP_BASE_URL (örn. https://app.b2bworker.com) absolute handler URL’leri için önerilir.
API özeti
| Method | Path | Auth |
|---|---|---|
GET/PUT | /api/v1/integrations/bitrix/ | JWT |
POST | /api/v1/integrations/bitrix/preview/ | JWT |
POST | /api/v1/integrations/bitrix/ensure-subscription/ | JWT |
POST | /api/v1/integrations/bitrix/hooks/{org_id}/ | Bitrix application_token |
POST | /api/v1/integrations/bitrix/result/{org_id}/ | X-Signature (subscription secret) |
Field map örneği (flight-change)
| Bitrix | B2B payload |
|---|---|
| (deal ID otomatik) | deal.bitrix_id |
CONTACT.PHONE | patient.phone |
CONTACT.NAME | patient.name |
UF_CRM_AIRPORT | flight.airport |
UF_CRM_FLIGHT_TIME | flight.time |
Sınırlamalar
- Bitrix outgoing webhook retry zayıf — handler’ınız hızlı 2xx dönmeli
201event kabulü ≠ WhatsApp teslim (Meta 24s / template kuralları geçerli)- MVP: tek portal / org, yalnızca Deal
- Marketplace app / OAuth sonraki faz
İlgili: testcrm ↔ app, Webhooks, Eventler