CRM Integration will GET but not POST?

Status
Not open for further replies.

rmnnet

Customer
Joined
Feb 12, 2021
Messages
13
Reaction score
4
I am working to integrate 3CX CRM integration with ERPNext. I've created a template that will successfully look up Contacts by the number, however neither the Call Journaling nor the Chat Journaling will work.

To troubleshoot, I edited the template to send the API request to a Pipedream Request Bin. When I make a call TO the 3CX system, I can see in Pipedream that it's getting a new GET request (and it also worked with the ERP, itself). However, I never see a POST request (the Call Journaling).

XML:
<?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="ERPNext" Version="1" SupportsEmojis="true">
  <Number Prefix="AsIs" MaxLength="[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:" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="False" />
    <Parameter Name="Subject" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Call Subject:" Default="3CX PhoneSystem Call" />
    <Parameter Name="InboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Answered Inbound Call:" Default="[DateTime]: Answered incoming call from [Number] to [Agent] ([Duration])" />
    <Parameter Name="MissedCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Missed Call:" Default="[DateTime]: Missed call from [Number] to [Agent]" />
    <Parameter Name="OutboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Answered Outbound Call:" Default="[DateTime]: Answered outgoing call from [Agent] to [Number] ([Duration])" />
    <Parameter Name="NotAnsweredOutboundCallText" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Unanswered Outbound Call:" Default="[DateTime]: Unanswered outgoing call from [Agent] to [Number]" />
  </Parameters>
  <Authentication Type="Basic">
    <Value>[UserName]:[Password]</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="" Type="REST">
      <Request Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">data.name</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="data.name">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="data.first_name">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="data.last_name">
          <Filter />
        </Variable>
        <Variable Name="CompanyName" Path="data.company_name">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="data.email_id">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="data.company_phone">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="data.mobile_no">
          <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="mycrm.com" />
        <Output Type="EntityId" Passes="0" Value="[ContactID]" />
        <Output Type="EntityType" Passes="0" Value="Contacts" />
      </Outputs>
    </Scenario>
    <Scenario Id="LookupByEmail" Type="REST">
      <Request Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">data.name</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="data.name">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="data.first_name">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="data.last_name">
          <Filter />
        </Variable>
        <Variable Name="CompanyName" Path="data.company_name">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="data.email_id">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="data.company_phone">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="data.mobile_no">
          <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="mycrm.com" />
        <Output Type="EntityId" Passes="0" Value="[ContactID]" />
        <Output Type="EntityType" Passes="0" Value="Contacts" />
      </Outputs>
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]==&quot;&quot;,True,[IIf([CallType]!=Inbound,True,False)])]" Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="reference_doctype" Passes="1" Type="String">Lead</Value>
          <Value Key="reference_name" Passes="1" Type="String">CRM-LEAD-2023-00473</Value>
          <Value Key="content" Passes="1" Type="String">Jut a test</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs Next="ReportCallMissed" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallMissed" Type="REST">
      <Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]==&quot;&quot;,True,[IIf([CallType]!=Missed,True,False)])]" Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="reference_doctype" Passes="1" Type="String">Lead</Value>
          <Value Key="reference_name" Passes="1" Type="String">CRM-LEAD-2023-00473</Value>
          <Value Key="content" Passes="1" Type="String">Jut a test</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs Next="ReportCallOutbound" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallOutbound" Type="REST">
      <Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]==&quot;&quot;,True,[IIf([CallType]!=Outbound,True,False)])]" Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="reference_doctype" Passes="1" Type="String">Lead</Value>
          <Value Key="reference_name" Passes="1" Type="String">CRM-LEAD-2023-00473</Value>
          <Value Key="content" Passes="1" Type="String">Jut a test</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs Next="ReportCallNotanswered" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallNotanswered" Type="REST">
      <Request SkipIf="[IIf([ReportCallEnabled]!=True||[EntityId]==&quot;&quot;,True,[IIf([CallType]!=Notanswered,True,False)])]" Url="https://sdfsdfasdf321m.pipedream.net" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <PostValues Key="">
          <Value Key="reference_doctype" Passes="1" Type="String">Lead</Value>
          <Value Key="reference_name" Passes="1" Type="String">CRM-LEAD-2023-00473</Value>
          <Value Key="content" Passes="1" Type="String">Jut a test</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
  </Scenarios>
</Crm>
 
  • Like
Reactions: ENG
Call & Chat Journaling require that you have a matched contact during the lookup phase, and that you return an EntityId and EntityType. Can you check in the logs if this is the case? Please enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings. Then make a test call where you reproduce the issue, and check the 3cxSystemService.log file that you can download from the 3CX Console > Dashboard > Activity Log > Logs button > Instance folder.
 
  • Like
Reactions: Evolute IT
Call & Chat Journaling require that you have a matched contact during the lookup phase, and that you return an EntityId and EntityType. Can you check in the logs if this is the case? Please enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings. Then make a test call where you reproduce the issue, and check the 3cxSystemService.log file that you can download from the 3CX Console > Dashboard > Activity Log > Logs button > Instance folder.
What about instances when there isn't a matching contact in the CRM? Shouldn't 3CX create one, and then journal the call?

What does the EntityId and EntityType represent?
 
What about instances when there isn't a matching contact in the CRM? Shouldn't 3CX create one, and then journal the call?
You can do this if you want. You will need to chain scenarios, and execute a contact creation scenario when there are no matched contacts during lookup.

What does the EntityId and EntityType represent?
The EntityId should be set to the matched contact id. We name it "entity" because this can be a contact, a lead or an account, some CRMs have multiple places to search for phone numbers. The EntityType is something that you define, to understand if the call matched a contact, a lead, an account, or anything else that your CRM supports. You will use it in your Call Journaling scenario to send the POST request to the appropriate endpoint when your CRM supports multiple entities. If this is not your case, you can leave it blank or set it to "contact", 3CX will not do anything with this, it's just passed on to the Call Journaling scenario.
 
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,882
Members
165,467
Latest member
EMMEPICASA