3cx template integration

Status
Not open for further replies.

Nos

Customer
Joined
Apr 7, 2020
Messages
13
Reaction score
0
Hello,

we have created a template. We also get an answer from our CRM. This can be seen in the picture in the appendix. But no user is created. The Json data are inserted in the variables as you can see.
When a call is made to the system, no user is created and no name is shown on the display.

What should I do?
 

Attachments

  • WhatsApp Image 2020-04-08 at 15.46.37.jpeg
    WhatsApp Image 2020-04-08 at 15.46.37.jpeg
    124.5 KB · Views: 16
The returned contact is only considered when it has the following outputs:
1) At least the first name, last name or company name.
2) One of the phone fields contains the caller number.
3) The ContactUrl which is mandatory.

Is your template generating all these outputs? Can I see your template to check this?
 
Yea sure here is the template:


<?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="nos" Version="1">
<Number Prefix="AsIs" MaxLength="" />
<Connection MaxConcurrentRequests="2" />
<Parameters>
<Parameter Name="UserName" Type="String" Parent="General Configuration" Editor="String" Title="Username:" />
<Parameter Name="Password" Type="Password" Parent="General Configuration" Editor="String" Title="Password:" />
</Parameters>
<Authentication Type="Basic">
<Value>[UserName]:[Password]</Value>
</Authentication>
<Scenarios>
<Scenario Id="" Type="REST">
<Request Url="https://xxx.xxx.xxxx/getnamebynumber?Number=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Rules>
<Rule Type="Any">contact.id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="contact.id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="contact.first_name">
<Filter />
</Variable>
<Variable Name="LastName" Path="contact.last_name">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="contact.name">
<Filter />
</Variable>
<Variable Name="PhoneBusiness" Path="contact.contact_kind__name">
<Filter />
</Variable>
<Variable Name="ContactUrl" Path="contact.contact_kind__name">
<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="PhoneBusiness" Passes="0" Value="[PhoneBusiness]" />
<Output Type="ContactUrl" Passes="0" Value="[ContactUrl]" />
</Outputs>
</Scenario>
</Scenarios>
</Crm>

hope this help you
 
Can you provide the full output from the Log tab when you make a test from the console? The screenshot you sent only shows the first lines, and we need to see the values generated for the output you defined.
 
yes sure,


I will now send all helpful material, I hope you can do something with the material


Matching_Scenario_Protokoll.png
 
The server not returning valid JSON. The response text is just "none"...
 
The server only returns 'none' if the number is not entered in the database.


If the number is in the database, you can see above that the variables are also set to the correct values.


What is the ID all about?

because the scenario always starts with an empty id
 
Here is another picture if the number can be found in the database. Because I can see I have sent 2 examples above where numbers have been tried that are not in the databasewhen_number_was_found.png
 
The server only returns 'none' if the number is not entered in the database.
3CX can't properly process this response, and you will always see an error in the log in this case. You can ignore the error anyway, but you will not be able to use the contact creation feature for example, because it needs a successful processing of the contact lookup scenario to be triggered.

What is the ID all about?

because the scenario always starts with an empty id
Each scenario has an ID. The lookup scenarios have an empty ID. Other scenarios, like the ReportCall or CreateContactRecord have specific IDs. You can also create your own scenarios, which can be called from the lookup scenario, resulting in chained scenarios. In those cases you will have scenarios with IDs. But for the most basic case of lookup scenarios, all of them will have an empty ID.

Here is another picture if the number can be found in the database. Because I can see I have sent 2 examples above where numbers have been tried that are not in the database
when_number_was_found.png
In this screenshot, I can see that the PhoneBusiness is being set to "asd". You need to set at least one output field to the number being searched. Otherwise the returned record is ignored.
 
thank you

now it works fine
 
There is no longer an error when you receive the CRM test function, but no contact is created when you call. What could be the problem?
 
shoud i add a CreateContactRecord ID? And which ID?
 
You need a contact creation scenario for this to work. This is a normal scenario with ID "CreateContactRecord". You can use the wizard to create this, but you would need to start your template from scratch. Or you can manually add it from the tool.
 
thank you very much.
 
Status
Not open for further replies.

Forum statistics

Threads
112,326
Messages
591,900
Members
165,479
Latest member
Senergia