CRM Integration

Benson Geoffrey

Joined
Sep 12, 2024
Messages
1
Reaction score
0
Hello, I am new in 3CX, I was in the middle of integrating our custom CRM, and I was able to complete the first scenario successfully except for the second scenario. I would like to post these values below

access_token (string): Access token
external_id (string): External Call ID
phone (string): Caller phone
inbound (string): Call direction ('true' | 'false')
started_at (string): Moment when call started ex:'2018-06-22 15:09:08' UTC

What am I missing in this script?

<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="3CXCustomerDetails" Version="0" SupportsEmojis="false">
<Number Prefix="AsIs" MaxLength="" />
<Connection MaxConcurrentRequests="2" />
<Parameters>
<Parameter Name="AccessToken" Type="String" Parent="General Configuration" Editor="String" Title="Access Token" Default="iJxxxxx8" />
</Parameters>
<Authentication Type="No" />
<Scenarios>
<Scenario Id="CustomerDetails" Type="REST" EntityId="">
<Request SkipIf="" Url="https://xyz.com/api/pbx/v1/customers/search?access_token=[AccessToken]&amp;mobile=[Number]" MessagePasses="0" RequestContentType="Application/json" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">id</Rule>
</Rules>
<Variables>
<Variable Name="Customer ID:" Path="id">
<Filter />
</Variable>
<Variable Name="Full Name:" Path="full_name">
<Filter />
</Variable>
<Variable Name="Primary Mobile:" Path="primary_mobile">
<Filter />
</Variable>
<Variable Name="Region:" Path="region">
<Filter />
</Variable>
<Variable Name="District:" Path="district">
<Filter />
</Variable>
<Variable Name="Ward:" Path="ward">
<Filter />
</Variable>
<Variable Name="Service Tier:" Path="service_tier">
<Filter />
</Variable>
<Variable Name="Account Balance:" Path="account_balance">
<Filter />
</Variable>
</Variables>
<Outputs Next="CallVerification" AllowEmpty="true">
<Output Type="id" Passes="0" Value="id" />
<Output Type="full_name" Passes="0" Value="full_name" />
<Output Type="primary_mobile" Passes="0" Value="primary_mobile" />
<Output Type="region" Passes="0" Value="region" />
<Output Type="district" Passes="0" Value="district" />
<Output Type="ward" Passes="0" Value="ward" />
<Output Type="service_tier" Passes="0" Value="service_tier" />
<Output Type="account_balance" Passes="0" Value="account_balance" />
</Outputs>
</Scenario>
<Scenario Id="CallVerification" Type="REST" EntityId="">
<Request SkipIf="" Url="https://xyz.com/api/pbx/v1/calls/start_call" RequestType="Post" ResponseType="Json">
<PostValues>
<Value Key="access_token">[AccessToken]</Value>
<Value Key="external_id">[CallId]</Value>
<Value Key="phone">[Number]</Value>
<Value Key="inbound">[CallDirection]</Value>
<Value Key="Started_at">[DateTime]</Value>
</PostValues>
</Request>
</Scenario>
</Scenarios>
</Crm>
 
The contact lookup scenario should have an empty ID. Remove the Id attribute so it's used when you make or receive a call.
 
  • Like
Reactions: Evolute IT
The whole template is wrong. The variables have invalid names, the outputs are not valid outputs, and the variables used in the CallVerification scenario are also not valid, except [Number] and [CallDirection].
 
Maybe you should try using the CRM Template Generator tool instead of a text editor, which will give you a frame work to avoid going beyond some limits.
 
  • Like
Reactions: Evolute IT

Members Online Now

Forum statistics

Threads
111,835
Messages
589,289
Members
164,668
Latest member
Infinity Network