- Joined
- May 3, 2020
- Messages
- 30
- Reaction score
- 10
Hi, I created some time ago a custom CRM template using 3CX template generator.
Here is the code:
We get the http call with all details but contactId value. In the 3CX panel, inside CDR I see the name of the caller so I'm sure the contact is recognized as a CRM contact.
I'm using 3CX v18; is there a different syntax?
Thanks very much
Here is the code:
Code:
<?xml version="1.0"?>
<Crm Country="IT" Name="Test" Version="1">
<Number Prefix="AsIs" MaxLength="[MaxLength]"/>
<Connection MaxConcurrentRequests="10"/>
<Parameters>
<Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True"/>
<Parameter Name="ApiKey" Type="String" Parent="General Configuration" Editor="String" Title="ApiKey" Default="{Token}"/>
<Parameter Name="TestClient" Type="String" Parent="General Configuration" Editor="String" Title="Test client URL" Default="{TestClient}"/>
<Parameter Name="TestServer" Type="String" Parent="General Configuration" Editor="String" Title="Test server url" Default="{TestServer}"/>
</Parameters>
<Authentication Type="No"/>
<Scenarios>
<Scenario Id="" Type="REST">
<Request Url="[TestServer]/api/v1/integrations/3cx/contacts?phoneNumber=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded"
RequestType="Get" ResponseType="Json">
<Headers>
<Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">contact.id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="contact.id">
<Filter/>
</Variable>
<Variable Name="FirstName" Path="contact.firstName">
<Filter/>
</Variable>
<Variable Name="LastName" Path="contact.lastName">
<Filter/>
</Variable>
<Variable Name="CompanyName" Path="contact.companyName">
<Filter/>
</Variable>
<Variable Name="Email" Path="contact.email">
<Filter/>
</Variable>
<Variable Name="PhoneBusiness" Path="contact.landlinePhone">
<Filter/>
</Variable>
<Variable Name="PhoneMobile" Path="contact.mobilePhone">
<Filter/>
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]"/>
<Output Type="FirstName" Passes="0" Value="[FirstName]"/>
<Output Type="LastName" Passes="0" Value="[LastName]"/>
<Output Type="CompanyName" Passes="0" Value="[CompanyName]"/>
<Output Type="Email" Passes="0" Value="[Email]"/>
<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]"/>
<Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]"/>
<Output Type="ContactUrl" Passes="0" Value="[TestClient]/contacts/[ContactID]/dashboard"/>
</Outputs>
</Scenario>
<Scenario Id="ReportCall" Type="REST">
<Request SkipIf="[ReportCallEnabled]!=True" Url="[TestServer]/api/v1/integrations/3cx/cdr" MessagePasses="0"
RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="Authorization" Passes="0" Type="String">Bearer [APIkey]</Value>
</Headers>
<PostValues Key="">
<Value Key="from" Passes="1" Type="String">[Number]</Value>
<Value Key="to" Passes="1" Type="String">[Agent]</Value>
<Value Key="type" Passes="1" Type="String">[CallType]</Value>
<Value Key="startDate" Passes="1" Type="String">[[CallStartTimeUTC].ToString("yyyy-MM-dd")]T[[CallStartTimeUTC].ToString("HH:mm:ss")]Z</Value>
<Value Key="endDate" Passes="1" Type="String">[[CallEndTimeUTC].ToString("yyyy-MM-dd")]T[[CallEndTimeUTC].ToString("HH:mm:ss")]Z</Value>
<Value Key="contactId" Passes="1" Type="String">[Contact::ContactID]</Value>
</PostValues>
</Request>
</Scenario>
</Scenarios>
</Crm>
We get the http call with all details but contactId value. In the 3CX panel, inside CDR I see the name of the caller so I'm sure the contact is recognized as a CRM contact.
I'm using 3CX v18; is there a different syntax?
Thanks very much