Custom CRM

netcure

Bronze Partner
Joined
Oct 23, 2014
Messages
2
Reaction score
0
Hi, i need please help,
i am new in 3cx and trying to connect to crm and create on the crm the contact if they are not there,
but the 3cx dont do nothing,

this is my code ---

<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="US" Name="PowerLink1" Version="1" SupportsEmojis="true">
<Number Prefix="AsIs" MaxLength="10" />
<Connection MaxConcurrentRequests="2" />
<Parameters>
<Parameter Name="APIkey" Type="String" Parent="General Configuration" Editor="String" Title="API Key:" Validation="" Default="" ListValues="" RequestUrl="" RequestUrlParameters="" ResponseScenario="" />
<Parameter Name="CreateContactEnabled" Type="String" Editor="String" Title="Enable Contact Creation" Default="False" />
<Parameter Name="CreateOnCallDirection" Type="List" Parent="CreateContactEnabled" Editor="String" Title="Create Contacts on Call Direction:" Default="Inbound" ListValues="Inbound,Inbound/Outbound" />
<Parameter Name="CreateContactFirstName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact First Name:" Default="New" />
<Parameter Name="CreateContactLastName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact Last Name:" Default="3CX Contact [Number]" />
</Parameters>
<Authentication Type="No">
<Value>[APIkey]:X</Value>
</Authentication>
<Scenarios>
<Scenario Id="" Type="REST" EntityId="" EntityOrder="">
<Request SkipIf="" Url="https://api.powerlink.co.il/api/query" MessagePasses="0" Message="{&#xD;&#xA; &quot;objecttype&quot;: 1, &#xD;&#xA; &quot;page_size&quot;: 1, &#xD;&#xA; &quot;fields&quot;: &quot; telephone1, accountid, accountname&quot;, &#xD;&#xA; &quot;query&quot;: &quot;(telephone1 = [Number])&quot;&#xD;&#xA;}" RequestContentType="application/json" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="tokenid" Passes="0" Type="String"></Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">data.Data</Rule>
</Rules>
<Variables>
<Variable Name="telephone1" Path="data.Data.telephone1">data.Data.telephone1<Filter /></Variable>
<Variable Name="accountname">data.Data.accountname<Filter /></Variable>
</Variables>
<Outputs Next="CreateContactRecord" AllowEmpty="false">
<Output Type="PhoneMobile" Passes="0" Value="[telephone1]" />
<Output Type="FirstName" Passes="0" Value="[accountname]" />
</Outputs>
</Scenario>
<Scenario Id="CreateContactRecord" Type="REST">
<Request SkipIf="[CreateContactEnabled]!=True||[IIf([CreateOnCallDirection]==Inbound,[CallDirection]!=Inbound,False)]==True" Url="https://api.powerlink.co.il/api/record/1" MessagePasses="0" Message="{&#xD;&#xA; &quot;Accountname&quot; : &quot;drorkkkkkkk&quot;,&#xD;&#xA; &quot;Telephone1&quot; : '[Number]',&#xD;&#xA; &quot;Originatingleadcode&quot; : &quot;2&quot;&#xD;&#xA;}" RequestContentType="application/json" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="tokenid" Passes="0" Type="String"></Value>
</Headers>
</Request>
<Rules>
<Rule Type="Any">data.Data</Rule>
</Rules>
<Variables>
<Variable Name="telephone1" Path="data.Data.telephone1">
<Filter />
</Variable>
<Variable Name="accountname" Path="data.Data.accountname">
<Filter />
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="PhoneMobile" Passes="2" Value="[telephone1]" />
<Output Type="FirstName" Passes="0" Value="[accountname]" />
</Outputs>
</Scenario>
</Scenarios>
</Crm>


this is in the log ---

[Integration.Crm.Engine.SearchNumberScenarioProcessor] CRM: The response is: '{"success":true,"data":{"ObjectName":"לקוח","SystemName":"Account","PrimaryKey":"accountid","PrimaryField":"accountname","ObjectType":1,"PageNum":1,"SortBy":"","SortBy_Desc":false,"IsLastPage":true,"Columns":[{"name":"טלפון ראשי","fieldname":"telephone1","systemfieldtypeid":"3f62f67a-1cee-403a-bec6-aa02a9804edb","fieldobjecttype":null,"isprimaryfield":false,"isrequired":false,"isreadonly":false,"maxlength":50},{"name":"לקוח","fieldname":"accountid","systemfieldtypeid":"a8fcdf65-91bc-46fd-82f6-1234758345a1","fieldobjecttype":1,"isprimaryfield":false,"isrequired":false,"isreadonly":false,"maxlength":null},{"name":"שם לקוח","fieldname":"accountname","systemfieldtypeid":"a1e7ed6f-5083-477b-b44c-9943a6181359","fieldobjecttype":null,"isprimaryfield":true,"isrequired":true,"isreadonly":false,"maxlength":200}],"Data":[]},"message":""}'
CRM: Unknown path element: telephone1. Null value is returned.
CRM: Unknown path element: accountname. Null value is returned.
CRM: Filtered variables for matching:
CRM: 'accountname' = ''
CRM: 'telephone1' = ''
CRM: Processing scenario 'CreateContactRecord'.
CRM: Creating new HttpClient with no authentication
CRM: Skipping request...
CRM: No matchings found.


please can someone help.
thanks.
 
The scenario named "CreateContactRecord" should be renamed to "CreateContactRecordFromClient". You can check existing integrations and compare with what you have.
 
  • Like
Reactions: Evolute IT
thanks, it ok now.