Custom CRM: specified API not called

Status
Not open for further replies.

yetopen

Customer
Joined
Jul 18, 2019
Messages
110
Reaction score
14
Hi.
I'm trying to develop Zimbra integration via custom API. I created a custom XML template (here), it gets imported and configured correctly but when I try to perform a test 3CX says the call has been made but no result has been returned, instead I see in the debug console no call has been made at all! I checked in /var/lib/3cxpbx/Instance1/Data/Logs but I see no evidence of the CRM call being made, am I looking into the wrong place?

Thanks
 
  • Like
Reactions: Grant Moxom
When you test from the console, you need to see the Logs tab, which will give you all the details of what's going on. It would be good to see what you have there, please remove any sensitive information before sending.

The 3cxSystemService.log file will contain this information only for real calls. So if you test from the console, you should not check this file, as there will be nothing there...
 
Thanks for your reply, but I probably miss some basics of CRM integration. I did some other trial/error during the weekend, from what I could see all the features must be implemented, while I only did contacts lookup, as there's no reason to record phone calls in Zimbra. Is this true? Does 3CX require contact creation and call logging for a template?
 
Thanks for your reply, but I probably miss some basics of CRM integration. I did some other trial/error during the weekend, from what I could see all the features must be implemented, while I only did contacts lookup, as there's no reason to record phone calls in Zimbra. Is this true? Does 3CX require contact creation and call logging for a template?
No, this is not required. If you don't implement those features, then you will not have them. But you can work with contact lookup only... Have you checked the Logs tab from the console when you make a test?
 
Have you checked the Logs tab from the console when you make a test?
Honestly I don't know where to find the logs tab.

Anyway with that XML file even the wizard will not perform any call to my API
 
Honestly I don't know where to find the logs tab.

Anyway with that XML file even the wizard will not perform any call to my API
When you go to the 3CX Console > Settings > CRM Integration > Test button, and you make a test, you will see the following tab:
1587419358417.png

There you will see all the interactions between 3CX and the CRM.
 
The problem is that it doesn't run the request, nothing at all. Even in the 3CX CRM Template Generator Wizard, I fill the apiBaseUrl param and issue a Contact Lookup, I see the call in the Parameter Values leaf of the tree, but all the tabs and windows are completely empty.

This is the template. Any hint where to look at would be welcome. Thanks again

XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="US" Name="Zimbra" Version="1">
  <Number Prefix="AsIs" MaxLength="[MaxLength]" />
  <Connection MaxConcurrentRequests="2" />
  <Parameters>
    <Parameter Name="apiBaseUrl" Type="String" Editor="String" Title="API base url with protocol, host and port, without trailing slash" />
  </Parameters>
  <Authentication Type="No">
    <Value>[UserName]:[Password]</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="getContact" Type="REST">
      <Request Url="[apiBaseUrl]/v1/search/[Number]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="id">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="firstName">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="lastName">
          <Filter />
        </Variable>
        <Variable Name="CompanyName" Path="company">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="email">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="workPhone">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="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="https://zimbra.com/contact/[ContactID]" />
      </Outputs>
    </Scenario>
  </Scenarios>
</Crm>
 
The problem is that you have set an ID to the lookup scenario:
Id="getContact"

Only the scenarios without ID are used for contact lookup. Remove that attribute and it should be triggered.
 
Thank you very much, now the simulation in the wizard works perfectly.

Unfortunately it doesn't get imported: the XML is uploaded, I see it loading but then nothing happens on the backend. I checked the Network tab of the browser, I just see the server replying with the template name and nothing more
 
Last edited:
Try deleting the existing template, and then uploading it again.
 
  • Like
Reactions: yetopen
Thanks I removed /var/lib/3cxpbx/Instance1/Data/Http/Templates/crm/Zimbra.xml and I've been able to import it. It's working! Thank you again
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Forum statistics

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