Technical specification

Integration of any CRM system with 3CX using the WebAPI + Webhook Generator for 3CX
1. Integrate incoming calls
Step 0. Install WebAPI + Webhook CRM Bundle to your 3CX server (on-premise only)
Step 1. Configure your CRM system to accept webhook events (HTTPs POST requests) from 3CX ip address.
Step 1a. Specify the URL of your CRM system for the webhook generator.
Step 2. Create an incoming call based on the first webhook of the ringing event
  • callerid - external number of customer
  • user - internal number of the IVR
  • chid - unique ID of the call chain
  • inbound_did - DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "event": "ringing",
    "callerid": "381629759787",
    "user": "809",
    "usertype": "other",
    "did": "DID Serbia 021 3220 030",
    "id": "250917161728_41-0",
    "chid": "00000000-01dc-27dd-cc8a-799100000029",
    "inbound_did": "381213220030",
    "sip_displayname": "381629759787",
    "phonebook": "Smith, John",
    "call_id1": "e1d9f75e-0e73-123f-b3a2-005056be101b;to-tag=8a5c6e0d;from-tag=Ue91FUB2ZBF6B",
    "call_id2": ""
}
Step 2a. Record missed call in CRM system when it occur in the IVR menu or service queue, triggered by the corresponding webhook event
  • callerid - external number of customer
  • user - internal number of the IVR
  • chid - unique ID of the call chain
  • inbound_did - DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "event": "incoming",
    "callerid": "381629759787",
    "user": "809",
    "finishtype": "Missed",
    "transfer": "False",
    "breakside": "Undef",
    "did": "DID Serbia 021 3220 030",
    "title": "DID Serbia 021 3220 030:Missed call  by IVR 809 from 381629759787",
    "id": "250917161728_41-0",
    "chid": "00000000-01dc-27dd-cc8a-799100000029",
    "inbound_did": "381213220030",
    "sip_displayname": "381629759787",
    "phonebook": "Smith, John",
    "call_id1": "e1d9f75e-0e73-123f-b3a2-005056be101b;to-tag=8a5c6e0d;from-tag=Ue91FUB2ZBF6B",
    "call_id2": "fbOC_H_YLvjdus8WVW7ocw..;from-tag=94183327;to-tag=8e77c732",
    "termination_reason_details": "by_did",
    "source_presentation": "Smith, John:DID Serbia 021 3220 030"
}
Step 3. Trigger opening of the customer’s CRM card upon the pickupIncoming webhook event
  • callerid - external number of customer
  • user - user extension
  • chid - unique ID of the call chain
  • inbound_did - DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "callerid": "381629759787",
    "event": "pickupincoming",
    "user": "105",
    "did": "DID Serbia 021 3220 030",
    "trtype": "NotDef",
    "id": "250917190514_45-1",
    "chid": "00000000-01dc-27f5-3c43-81de0000002d",
    "inbound_did": "381213220030",
    "sip_displayname": "381629759787",
    "phonebook": "Smith, John",
    "call_id1": "51860fab-0e8b-123f-b3a2-005056be101b;to-tag=e4206478;from-tag=mDm0KNr2r4rKD",
    "call_id2": "fe63887e-c64d-4f89-ada6-309ce28a5e4b;to-tag=6f0d405e;from-tag=36dd9a2c-6039-4a65-87b2-22f787792d62"
}
Step 4a. Record the duration of each successful incoming call and attach a link to the .mp3 or .wav conversation file
  • callerid - external number of customer
  • user - user extension
  • chid - unique ID of the call chain
  • inbound_did - DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "FILES": [
        "https://api.3cx.eu/webapi/recording/250917190514_45-1-1.mp3"
    ],
    "event": "incoming",
    "callerid": "381629759787",
    "user": "105",
    "finishtype": "Ok",
    "transfer": "False",
    "breakside": "External",
    "did": "DID Serbia 021 3220 030",
    "title": "DID Serbia 021 3220 030:Answered call from 381629759787 (0:07)",
    "id": "250917190514_45-1",
    "chid": "00000000-01dc-27f5-3c43-81de0000002d",
    "inbound_did": "381213220030",
    "sip_displayname": "381629759787",
    "phonebook": "Smith, John",
    "call_id1": "51860fab-0e8b-123f-b3a2-005056be101b;to-tag=e4206478;from-tag=mDm0KNr2r4rKD",
    "call_id2": "cg0tTWS7tWqn2aJzJU39PA..;from-tag=425b177d;to-tag=9524b651",
    "termination_reason_details": "none",
    "source_presentation": "Smith, John:DID Serbia 021 3220 030"
}
Step 4b. Add the recognized call transcription to the CRM system based on the latest webhook
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "event": "ai",
    "id": "250917190514_45-1",
    "summary": "Customer contacted the bank’s service desk about an unknown €120 transaction from the previous day. The agent created a case and forwarded it to the fraud team. Resolution expected within 48 hours.",
    "transcription": "Hi i need to check something on my account please… sure can you tell me what the issue is… yes i see a transaction from yesterday for 120 euros that i dont recognize… okay i will open a case and send it to our fraud team you should hear back within forty eight hours… thank you very much… youre welcome have a nice day",
    "sentiment_score": "5"
}
2. Integrate outgoing calls
Step 1. Initiate an outgoing call from the CRM system through a simple GET request
  • first - internal number of the employee on whose behalf the call is being made
  • second - external number of customer to whom the call is being made
  • contact - specified device (optional)
  • timeout - response timeout in milliseconds
GET /webapi/JNJP5UqGDhX/makecall?first=800&second=381629759787&contact=100&timeout=2000 HTTP/1.1
Host: api.3cx.eu
Capture unique ID of you call. Use this chid to track subsequent stages of the call
{
    "chid": "00000000-01dc-27fa-d1eb-64b00000002e"
}
Step 1a. Record the failed outgoing call in the CRM system along with the rejection reason
  • callerid - external number of customer
  • user - user extension
  • termination_reason_details - rejection reason
  • source_presentation - outgoing DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "event": "outgoing",
    "callerid": "381629759787",
    "user": "105",
    "finishtype": "Missed",
    "transfer": "False",
    "breakside": "Undef",
    "did": "",
    "title": "Unanswered call to 381629759787",
    "id": "250917194513_46-0",
    "chid": "00000000-01dc-27fa-d1eb-64b00000002e",
    "inbound_did": "381629759787",
    "sip_displayname": "",
    "phonebook": "",
    "call_id1": "mf5zBO50gjyzLA3rLgaZkA..;from-tag=3510c33e;to-tag=2c2c4b61",
    "call_id2": "a2c4c06a-21d7-4d43-b58c-db3871740d61;to-tag=59329b7a;from-tag=81865a8a-e9a9-4bf6-a597-9e496bfda25a",
    "termination_reason_details": "declined",
    "source_presentation": "381213220030"
}
Step 2. Trigger opening of the customer’s CRM card upon the pickupOutgoing webhook event
  • callerid - external number of customer
  • user - user extension
  • chid - unique ID of the call chain
  • source_presentation - outgoing DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "callerid": "381629759787",
    "event": "pickupoutgoing",
    "user": "105",
    "did": "",
    "trtype": "NotDef",
    "id": "250917195359_47-1",
    "chid": "00000000-01dc-27fc-0bdb-88fd0000002f",
    "inbound_did": "",
    "sip_displayname": "",
    "phonebook": "",
    "call_id1": "170f530d-7af4-4081-9af1-6c3d88afc411;to-tag=3d10a53b;from-tag=eca65e6e-efc4-436a-8bcf-041f27b8267c",
    "call_id2": "0-I_xdErJxAvrSrfWr4eNA..;from-tag=ba2c291a;to-tag=as0775c705"
}
Step 3. Record the duration of each successful outgoung call and attach a link to the .mp3 or .wav conversation file
  • callerid - external number of customer
  • user - user extension
  • chid - unique ID of the call chain
  • source_presentation - outgoing DID number
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "FILES": [
        "https://api.3cx.eu/webapi/recording/250917195359_47-1-1.mp3"
    ],
    "event": "outgoing",
    "callerid": "381629759787",
    "user": "105",
    "finishtype": "Ok",
    "transfer": "False",
    "breakside": "Internal",
    "did": "",
    "title": "Successful call to 381629759787 (0:05)",
    "id": "250917195359_47-1",
    "chid": "00000000-01dc-27fc-0bdb-88fd0000002f",
    "inbound_did": "381629759787",
    "sip_displayname": "",
    "phonebook": "",
    "call_id1": "MQdyDv4dHEvGFw8FZ6u49w..;from-tag=2950160b;to-tag=34643343",
    "call_id2": "170f530d-7af4-4081-9af1-6c3d88afc411;to-tag=3d10a53b;from-tag=eca65e6e-efc4-436a-8bcf-041f27b8267c",
    "termination_reason_details": "polling",
    "source_presentation": "381213220030"
}
Step 3a. Add the recognized call transcription to the CRM system based on the latest webhook
POST /webhooks/ HTTP/1.1
Host: crm.company.com
Content-Type: application/json

{
    "event": "ai",
    "id": "250917195359_47-1",
    "summary": "Customer received a positive outbound call about a weekend swimming pool discount and accepted the offer.",
    "transcription": "Hello this is the call center we have a special offer for you there is a weekend discount for the swimming pool would you like to take advantage. Yes that sounds great thank you very much. Wonderful have a nice day",
    "sentiment_score": "5"
}
The fastest and simplest integration our team has ever done. It took us just 3 days to fully integrate a CRM system with 3CX using the WebAPI + Webhook bundle from Creomate.
— SAP CRM dveloper