Prosperworks / Copper CRM integration

Status
Not open for further replies.

chrot

Joined
Jul 27, 2018
Messages
7
Reaction score
0
Hi Guys,

We are looking to create server side XML integration for Copper (used to go by the name of Prosperworks).

The Authentication method for their API is adding a few headers (X-PW-AccessToken, X-PW-Application and X-PW-UserEmail) on each request.

Is this currently possible? My other option is proxy'ing the requests trough an AWS lambda function.

Thanks!
 
Hello @chrot,

You can do it, however the tool doesn't support headers yet, so you will need to add them to the XML file manually. You add these headers inside the <Request> element, for example:
Code:
<Request Url="YOUR_URL" RequestType="Post" ResponseType="Json">
  <Headers>
    <Value Key="X-PW-AccessToken">access_token</Value>
    <Value Key="X-PW-Application">application</Value>
    <Value Key="X-PW-UserEmail">user_email</Value>
  </Headers>
</Request>

Kind regards.
 
We will be releasing a new version of the tool supporting all this, and also updating the documentation. Thanks for your feedback!
 
Little confused; I came up with the template below.. Unfortunately when I upload it to 3CX, and I click the 'Show template' button, the Header element is gone... Also, the Test button keeps telling me Unauthorized (suggesting the headers are missing)..

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="Copper" Version="2">
  <Number Prefix="Plus" MaxLength="" />
  <Connection MaxConcurrentRequests="16" />
  <Parameters>
    <Parameter Name="X-PW-AccessToken" Type="String" Title="AccessToken:" />
    <Parameter Name="X-PW-Application" Type="String" Title="Application:" Default="developer_api" />
    <Parameter Name="X-PW-UserEmail" Type="String" Title="UserEmail:"/>
  </Parameters>
  <Authentication Type="No"></Authentication>
  <Scenarios>
    <Scenario>
      <Request Url="https://api.prosperworks.com/developer_api/v1/people/search" Message="{&quot;phone_number&quot;:&quot;[Number]&quot;}" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
        <Headers>
          <Value Key="X-PW-AccessToken">[X-PW-AccessToken]</Value>
          <Value Key="X-PW-Application">[X-PW-Application]</Value>
          <Value Key="X-PW-UserEmail">[X-PW-UserEmail]</Value>
        </Headers>
      </Request>
      <Rules>
        <Rule Type="Any">number</Rule>
      </Rules>
      <Variables>
        <Variable Name="PhoneBusiness">number<Filter /></Variable>
        <Variable Name="FirstName">data.first_name<Filter /></Variable>
        <Variable Name="MiddleName">data.middle_name<Filter /></Variable>
        <Variable Name="LastName">data.last_name<Filter /></Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="PhoneBusiness" Value="[PhoneBusiness]" />
        <Output Type="FirstName" Value="[FirstName] [MiddleName]" />
        <Output Type="LastName" Value="[LastName]" />
        <Output Type="ContactUrl" Value="https://still-needs-work.com" />
      </Outputs>
    </Scenario>
  </Scenarios>
</Crm>

(please note: I havent touched the Variables and Output section yet.)
 
Can you try adding the Passes attribute?
Code:
<Value Passes="1" Key="X-PW-AccessToken">[X-PW-AccessToken]</Value>
<Value Passes="1" Key="X-PW-Application">[X-PW-Application]</Value>
<Value Passes="1" Key="X-PW-UserEmail">[X-PW-UserEmail]</Value>
 
Unfortunately Headers still gets removed from the Request element.
 
Are you running the latest Update 6 of 3CX v15.5?
 
15.5, I didn't see update 6 was released yet.. should I upgrade for this to work?

Thanks!
 
I'm not sure when this functionality was added, but for sure it's available in Update 6, so it's worth to try upgrading your PBX.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei