- Joined
- Apr 17, 2019
- Messages
- 16
- Reaction score
- 0
Hi,
I've nearly finished our Copper <> 3CX integration however cannot get the CreateContactRecord scenario to work. The problem is that the CreateContactRecord scenario should only be triggered if the lookup fails in the matching scenario, however I cannot figure out how to skip the CreateContactRecord based on the output of Matching Scenario.
When the match returns a contact (it uses a POST instead of a get request), unfortunately the CreateContactRecord always triggers.
I could fix this if the CreateContactRecord had access to the variables defined inside the Matching Scenario, but it does not.
Here is the relevant part of the XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="DE" Name="Copper3CXv2" Version="2">
<Number Prefix="AsIs" MaxLength="14" />
<Connection MaxConcurrentRequests="8" />
<Parameters>
<Parameter Name="X-PW-AccessToken" Type="String" Editor="String" Title="Copper API Key:" Default="" ListValues="" />
<Parameter Name="X-PW-Application" Type="String" Parent="" Editor="String" Title="Copper Application:" Default="developer_api" ListValues="" />
<Parameter Name="X-PW-UserEmail" Type="String" Editor="String" Title="Copper Dev Email:" Default="" ListValues="" />
<Parameter Name="CopperAPI" Type="String" Editor="String" Title="Copper API URL:" Default="https://api.prosperworks.com/developer_api/v1" ListValues="" />
<Parameter Name="PhoneCallActivityId" Type="String" Editor="String" Title="Copper Activity ID:" Default="781151" />
<Parameter Name="InboundCallText" Type="String" Editor="String" Title="Answered Inbound Call:" Default="[DateTime]: [Agent] answered call from [Contact::FirstName] [Contact::LastName] ([Number]) ([Duration])" />
<Parameter Name="MissedInboundCallText" Type="String" Editor="String" Title="Missed Inbound Call:" Default="[DateTime]: [Agent] missed call from [Contact::FirstName] [Contact::LastName] ([Number])" />
<Parameter Name="OutboundCallText" Type="String" Editor="String" Title="Answered Outbound Call:" Default="[DateTime]: [Agent] called [Contact::FirstName] [Contact::LastName] ([Number]) ([Duration])" />
<Parameter Name="MissedOutboundCallText" Type="String" Editor="String" Title="Missed Outbound Call:" Default="[DateTime]: [Agent] attempted to call [Contact::FirstName] [Contact::LastName] ([Number])" />
<Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
<Parameter Name="CreateContactEnabled" Type="Boolean" Editor="String" Title="Enable Contact Creation:" Default="False" />
<Parameter Name="CreateContactName" Type="Double" Editor="String" Title="Default Contact Name:" Default="3CXContact" ListValues="3CXContact,NewContact" />
</Parameters>
<Authentication Type="No">
<Value />
</Authentication>
<Scenarios>
<Scenario Id="" Type="REST">
<Request SkipIf="" Url="[CopperAPI]/people/search" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="X-PW-AccessToken" Passes="0" Type="String">[X-PW-AccessToken]</Value>
<Value Key="X-PW-Application" Passes="0" Type="String">[X-PW-Application]</Value>
<Value Key="X-PW-UserEmail" Passes="0" Type="String">[X-PW-UserEmail]</Value>
</Headers>
<PostValues>
<Value Key="sort_by" Passes="0" Type="String">date_modified</Value>
<Value Key="sort_direction" Passes="0" Type="String">desc</Value>
<Value Key="page_size" Passes="0" Type="String">1</Value>
<Value Key="phone_number" Passes="0" Type="String">[Number]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Number" Ethalon="">phone_numbers.number</Rule>
</Rules>
<Variables>
<Variable Name="CopperID" Path="id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="first_name">
<Filter />
</Variable>
<Variable Name="LastName" Path="last_name">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="company_name">
<Filter />
</Variable>
<Variable Name="WorkPhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="work">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="MobilePhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="mobile">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="HomePhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="home">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="PersonalEmail" Path="emails.email">
<Filter>
<Rule Type="Equals" Ethalon="personal">emails.category</Rule>
</Filter>
</Variable>
<Variable Name="WorkEmail" Path="emails.email">
<Filter>
<Rule Type="Equals" Ethalon="work">emails.category</Rule>
</Filter>
</Variable>
</Variables>
<Outputs Next="" AllowEmpty="false">
<Output Type="CopperID" Passes="0" Value="[CopperID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="company_name" />
<Output Type="PhoneBusiness" Passes="0" Value="[WorkPhone]" />
<Output Type="PhoneMobile" Passes="0" Value="[MobilePhone]" />
<Output Type="PhoneHome" Passes="0" Value="[HomePhone]" />
<Output Type="EmailPersonal" Passes="0" Value="[PersonalEmail]" />
<Output Type="EmailWork" Passes="0" Value="[WorkEmail]" />
</Outputs>
</Scenario>
<Scenario Id="CreateContactRecord" Type="REST">
<Request SkipIf="[CreateContactEnabled]!=True||[CopperID]!=null" Url="[CopperAPI]/people" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="X-PW-AccessToken" Passes="0" Type="String">[X-PW-AccessToken]</Value>
<Value Key="X-PW-Application" Passes="0" Type="String">[X-PW-Application]</Value>
<Value Key="X-PW-UserEmail" Passes="0" Type="String">[X-PW-UserEmail]</Value>
</Headers>
<PostValues>
<Value Key="name" Passes="0" Type="String">[CreateContactName]</Value>
<Value Key="details" Passes="0" Type="String">Created by 3CX</Value>
<Value Key="first_name" Passes="0" Type="String">[CreateContactName]</Value>
<Array Key="phone_numbers">
<Object>
<Value Key="number" Passes="0" Type="String">[Number]</Value>
<Value Key="category" Passes="0" Type="String">mobile</Value>
</Object>
</Array>
</PostValues>
</Request>
<Variables />
<Outputs AllowEmpty="false" />
</Scenario>
</Scenarios>
</Crm>
I would expect to be able to access the variables from the Matching Scenario – but my problem would be solved if I could somehow prevent the CreateContactRecord scenario from triggering every time (even when a matching contact is found in the Matching Scenario).
I've nearly finished our Copper <> 3CX integration however cannot get the CreateContactRecord scenario to work. The problem is that the CreateContactRecord scenario should only be triggered if the lookup fails in the matching scenario, however I cannot figure out how to skip the CreateContactRecord based on the output of Matching Scenario.
When the match returns a contact (it uses a POST instead of a get request), unfortunately the CreateContactRecord always triggers.
I could fix this if the CreateContactRecord had access to the variables defined inside the Matching Scenario, but it does not.
Here is the relevant part of the XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="DE" Name="Copper3CXv2" Version="2">
<Number Prefix="AsIs" MaxLength="14" />
<Connection MaxConcurrentRequests="8" />
<Parameters>
<Parameter Name="X-PW-AccessToken" Type="String" Editor="String" Title="Copper API Key:" Default="" ListValues="" />
<Parameter Name="X-PW-Application" Type="String" Parent="" Editor="String" Title="Copper Application:" Default="developer_api" ListValues="" />
<Parameter Name="X-PW-UserEmail" Type="String" Editor="String" Title="Copper Dev Email:" Default="" ListValues="" />
<Parameter Name="CopperAPI" Type="String" Editor="String" Title="Copper API URL:" Default="https://api.prosperworks.com/developer_api/v1" ListValues="" />
<Parameter Name="PhoneCallActivityId" Type="String" Editor="String" Title="Copper Activity ID:" Default="781151" />
<Parameter Name="InboundCallText" Type="String" Editor="String" Title="Answered Inbound Call:" Default="[DateTime]: [Agent] answered call from [Contact::FirstName] [Contact::LastName] ([Number]) ([Duration])" />
<Parameter Name="MissedInboundCallText" Type="String" Editor="String" Title="Missed Inbound Call:" Default="[DateTime]: [Agent] missed call from [Contact::FirstName] [Contact::LastName] ([Number])" />
<Parameter Name="OutboundCallText" Type="String" Editor="String" Title="Answered Outbound Call:" Default="[DateTime]: [Agent] called [Contact::FirstName] [Contact::LastName] ([Number]) ([Duration])" />
<Parameter Name="MissedOutboundCallText" Type="String" Editor="String" Title="Missed Outbound Call:" Default="[DateTime]: [Agent] attempted to call [Contact::FirstName] [Contact::LastName] ([Number])" />
<Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
<Parameter Name="CreateContactEnabled" Type="Boolean" Editor="String" Title="Enable Contact Creation:" Default="False" />
<Parameter Name="CreateContactName" Type="Double" Editor="String" Title="Default Contact Name:" Default="3CXContact" ListValues="3CXContact,NewContact" />
</Parameters>
<Authentication Type="No">
<Value />
</Authentication>
<Scenarios>
<Scenario Id="" Type="REST">
<Request SkipIf="" Url="[CopperAPI]/people/search" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="X-PW-AccessToken" Passes="0" Type="String">[X-PW-AccessToken]</Value>
<Value Key="X-PW-Application" Passes="0" Type="String">[X-PW-Application]</Value>
<Value Key="X-PW-UserEmail" Passes="0" Type="String">[X-PW-UserEmail]</Value>
</Headers>
<PostValues>
<Value Key="sort_by" Passes="0" Type="String">date_modified</Value>
<Value Key="sort_direction" Passes="0" Type="String">desc</Value>
<Value Key="page_size" Passes="0" Type="String">1</Value>
<Value Key="phone_number" Passes="0" Type="String">[Number]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Number" Ethalon="">phone_numbers.number</Rule>
</Rules>
<Variables>
<Variable Name="CopperID" Path="id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="first_name">
<Filter />
</Variable>
<Variable Name="LastName" Path="last_name">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="company_name">
<Filter />
</Variable>
<Variable Name="WorkPhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="work">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="MobilePhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="mobile">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="HomePhone" Path="phone_numbers.number">
<Filter>
<Rule Type="Equals" Ethalon="home">phone_numbers.category</Rule>
</Filter>
</Variable>
<Variable Name="PersonalEmail" Path="emails.email">
<Filter>
<Rule Type="Equals" Ethalon="personal">emails.category</Rule>
</Filter>
</Variable>
<Variable Name="WorkEmail" Path="emails.email">
<Filter>
<Rule Type="Equals" Ethalon="work">emails.category</Rule>
</Filter>
</Variable>
</Variables>
<Outputs Next="" AllowEmpty="false">
<Output Type="CopperID" Passes="0" Value="[CopperID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="company_name" />
<Output Type="PhoneBusiness" Passes="0" Value="[WorkPhone]" />
<Output Type="PhoneMobile" Passes="0" Value="[MobilePhone]" />
<Output Type="PhoneHome" Passes="0" Value="[HomePhone]" />
<Output Type="EmailPersonal" Passes="0" Value="[PersonalEmail]" />
<Output Type="EmailWork" Passes="0" Value="[WorkEmail]" />
</Outputs>
</Scenario>
<Scenario Id="CreateContactRecord" Type="REST">
<Request SkipIf="[CreateContactEnabled]!=True||[CopperID]!=null" Url="[CopperAPI]/people" Message="" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<Headers>
<Value Key="X-PW-AccessToken" Passes="0" Type="String">[X-PW-AccessToken]</Value>
<Value Key="X-PW-Application" Passes="0" Type="String">[X-PW-Application]</Value>
<Value Key="X-PW-UserEmail" Passes="0" Type="String">[X-PW-UserEmail]</Value>
</Headers>
<PostValues>
<Value Key="name" Passes="0" Type="String">[CreateContactName]</Value>
<Value Key="details" Passes="0" Type="String">Created by 3CX</Value>
<Value Key="first_name" Passes="0" Type="String">[CreateContactName]</Value>
<Array Key="phone_numbers">
<Object>
<Value Key="number" Passes="0" Type="String">[Number]</Value>
<Value Key="category" Passes="0" Type="String">mobile</Value>
</Object>
</Array>
</PostValues>
</Request>
<Variables />
<Outputs AllowEmpty="false" />
</Scenario>
</Scenarios>
</Crm>
I would expect to be able to access the variables from the Matching Scenario – but my problem would be solved if I could somehow prevent the CreateContactRecord scenario from triggering every time (even when a matching contact is found in the Matching Scenario).



