CRM - Syncro/Repairshopr CallerID and Journal

Status
Not open for further replies.

dinohead

Customer
Basic Certified
Joined
Apr 2, 2020
Messages
18
Reaction score
1
Hi

A buddy and I have been struggling with getting this to work. We've found one or two posts on here saying its working so we've built upon what they have.

A problem I have is after modifying using the CRM template generator I save with a new file name or overwrite, go to apply the template and 3CX doesn't accept it and reverts back to none. No reason at all for it other than the generator is somehow breaking the XML code?

So the main problem is in the CRM you have sub contacts within a company. Say John Smith and his mobile. The company is called Acme and their number is a landline. I can get it to fetch details for the landline but not the contact - API restriction. Is there a way to do two lookups and combine the data to work with the CRM plugin?

Here is the API page - https://api-docs.syncromsp.com/#/Call/get_callerid - callerid literally returns the name of the caller - subcontact or main contact. Cool but doesn't have any other useful data. It is important however as on the syncro/repairshopr end it logs the inbound or outbound call on the customer and it pops a little bubble. The json data for this is data.name for name.

The customers query which is my matching scenario currently https://api-docs.syncromsp.com/#/Customer/get_customers queries the customer data using the DID and finds all the juicy data like CRM link, address, name and number - but stupidly this doesn't work for anyone who is a subcontact. I guess a trade off for now would be to ignore the customers lookup and code it just to return the contact name "John Smith" and his mobile as a 3CX crm entry - that way I'll get basic caller ID, do the server side call logs and call pop but just miss out on the CRM link and who the actual company is...unless I can do both and append the company name?? Thanks

XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="GB" Name="SyncroRepairshopr" Version="1">
  <Number Prefix="Off" MaxLength="10" />
  <Connection MaxConcurrentRequests="2" />
  <Parameters>
    <Parameter Name="APIkey" Type="String" Parent="General Configuration" Editor="String" Title="API Key:" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
    <Parameter Name="Domain" Type="String" Editor="String" Title="Domain:" />
  </Parameters>
  <Authentication Type="Basic">
    <Value>[APIkey]:X</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="" Type="REST">
      <Request SkipIf="" Url="https://[Domain].syncromsp.com/api/v1/customers?query=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Number">customers.phone</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="customers.id">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="customers.firstname">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="customers.lastname">
          <Filter />
        </Variable>
        <Variable Name="CompanyName" Path="customers.business_name">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="customers.email">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="customers.phone">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="customers.mobile">
          <Filter />
        </Variable>
      </Variables>
      <Outputs Next="" AllowEmpty="true">
        <Output Type="ContactID" Passes="1" Value="[ContactID]" />
        <Output Type="FirstName" Passes="1" Value="[FirstName]" />
        <Output Type="LastName" Passes="1" Value="[LastName]" />
        <Output Type="CompanyName" Passes="1" Value="[CompanyName]" />
        <Output Type="Email" Passes="1" Value="[Email]" />
        <Output Type="PhoneBusiness" Passes="1" Value="[PhoneBusiness]" />
        <Output Type="PhoneMobile" Passes="1" Value="[PhoneMobile]" />
        <Output Type="ContactUrl" Passes="1" Value="https://[Domain].syncromsp.com/customers/[ContactID]" />
      </Outputs>
    </Scenario>
    <Scenario Type="REST">
      <Request Url="https://[Domain].syncromsp.com/api/v1/callerid?did=[Number]&amp;api_key=[APIkey]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Number">customers.phone</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactName" Path="data.name">
          <Filter />
        </Variable>
      </Variables>
      <Outputs AllowEmpty="true">
        <Output Type="CompanyName" Passes="0" Value="[ContactName]" />
      </Outputs>
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Inbound" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallMissed" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallMissed" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Missed" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallOutbound" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallOutbound" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Outbound" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;outbound=true&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallNotanswered" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallNotanswered" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Notanswered" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;outbound=true&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
  </Scenarios>
</Crm>
 
A problem I have is after modifying using the CRM template generator I save with a new file name or overwrite, go to apply the template and 3CX doesn't accept it and reverts back to none. No reason at all for it other than the generator is somehow breaking the XML code?
I can upload the template you pasted in this thread without any problem. Maybe you're using an old version of 3CX that doesn't accept new attributes or elements from the template... Do you have this problem with the template that you pasted here? Or is it after you make changes?

So the main problem is in the CRM you have sub contacts within a company. Say John Smith and his mobile. The company is called Acme and their number is a landline. I can get it to fetch details for the landline but not the contact - API restriction. Is there a way to do two lookups and combine the data to work with the CRM plugin?
You can chain scenarios. We have examples of this in our templates, which you can see. For example, in the Salesforce template we get the contact details, which returns a company ID, and then we use a second scenario to get the company name using this ID. The output of the second scenario can include variables collected in the first scenario. So you should be able to solve this problem using this technique... Take a look at our templates to understand how this works.
 
Thank you but I haven't thoroughly fathomed it yet. I swear the add CRM template is bugging on me. I'll literally change one thing, save and go to add and it will clear the current template and basically not accept the template. It works fine on the parameter test.

Anything wrong with this? Or is it the server side being buggy?

XML:
<?xml version="1.0"?>
<Crm xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Country="GB" Name="Syncro" Version="1">
  <Number Prefix="Off" MaxLength="11" />
  <Connection MaxConcurrentRequests="2" />
  <Parameters>
    <Parameter Name="APIkey" Type="String" Parent="General Configuration" Editor="String" Title="API Key:" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
    <Parameter Name="Domain" Type="String" Editor="String" Title="Domain:" />
  </Parameters>
  <Authentication Type="Basic">
    <Value>[APIkey]:X</Value>
  </Authentication>
  <Scenarios>
    <Scenario Id="" Type="REST">
      <Request SkipIf="" Url="https://[Domain].syncromsp.com/api/v1/customers?query=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Number">customers.phone</Rule>
      </Rules>
      <Variables>
        <Variable Name="ContactID" Path="customers.id">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="customers.firstname">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="customers.lastname">
          <Filter />
        </Variable>
        <Variable Name="CompanyName" Path="customers.business_name">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="customers.email">
          <Filter />
        </Variable>
        <Variable Name="PhoneBusiness" Path="customers.phone">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="customers.mobile">
          <Filter />
        </Variable>
      </Variables>
      <Outputs Next="" AllowEmpty="false">
        <Output Type="ContactID" Passes="1" Value="[ContactID]" />
        <Output Type="FirstName" Passes="1" Value="[FirstName]" />
        <Output Type="LastName" Passes="1" Value="[LastName]" />
        <Output Type="CompanyName" Passes="1" Value="[CompanyName]" />
        <Output Type="Email" Passes="1" Value="[Email]" />
        <Output Type="PhoneBusiness" Passes="1" Value="[PhoneBusiness]" />
        <Output Type="PhoneMobile" Passes="1" Value="[PhoneMobile]" />
        <Output Type="ContactUrl" Passes="1" Value="https://[Domain].syncromsp.com/customers/[ContactID]" />
      </Outputs>
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Inbound" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallMissed" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallMissed" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Missed" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallOutbound" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallOutbound" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Outbound" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;outbound=true&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs Next="ReportCallNotanswered" AllowEmpty="true" />
    </Scenario>
    <Scenario Id="ReportCallNotanswered" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True||[CallType]!=Notanswered" Url="https://[Domain].syncromsp.com/api/callerid.json/?did=[Number]&amp;outbound=true&amp;api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
  </Scenarios>
</Crm>

So tried two matching scenarios and a unique issue for anyone trying to do Repairshopr or Syncro.

The ReportCall URL which does the logging of calls also returns the name of the contact calling. This could be the main contact (which the matching scenario actually fetches along with all the company data) or any subcontacts (employees) - just their first and last name (Joe Bloggs). The problem is if Joe Bloggs calls on his mobile in theory I would like to take the CallerID response and whilst its not perfect (all the other company data) I would like to create a CRM contact/lookup with just Joe Bloggs and his mobile. The matching scenario returns nothing when Joe Bloggs calls so its not even like you can merge data.

AFAIK the only way to get Joe Bloggs mobile data would be to make a matching scenario for callerID (same URL as the reportcall url) only skip it if outbound (otherwise we log an incoming call when I'm calling out) but if incoming check make customer lookup first, and then use callerid data (name only) as a failover? Other issue I found is that the name and number is not enough to stop duplicates being made?

Ideally the API really should search for subcontacts... any ideas?
 
The first scenario doesn't have an Id
 
The first scenario doesn't have an Id

I believe matching scenarios don't? I guess what I'm ultimately after until the API improves is a way of doing:

IF [number] is found in CUSTOMER search do lookup and take details

OR

Do DID lookup and take just name & number
 
Thank you but I haven't thoroughly fathomed it yet. I swear the add CRM template is bugging on me. I'll literally change one thing, save and go to add and it will clear the current template and basically not accept the template. It works fine on the parameter test.

Anything wrong with this? Or is it the server side being buggy?
I can upload that template to my test PBX without any problem. Just in case, when you're going to update the template in your PBX, first delete the existing template, and then add the new one.

So tried two matching scenarios and a unique issue for anyone trying to do Repairshopr or Syncro.

The ReportCall URL which does the logging of calls also returns the name of the contact calling. This could be the main contact (which the matching scenario actually fetches along with all the company data) or any subcontacts (employees) - just their first and last name (Joe Bloggs). The problem is if Joe Bloggs calls on his mobile in theory I would like to take the CallerID response and whilst its not perfect (all the other company data) I would like to create a CRM contact/lookup with just Joe Bloggs and his mobile. The matching scenario returns nothing when Joe Bloggs calls so its not even like you can merge data.

AFAIK the only way to get Joe Bloggs mobile data would be to make a matching scenario for callerID (same URL as the reportcall url) only skip it if outbound (otherwise we log an incoming call when I'm calling out) but if incoming check make customer lookup first, and then use callerid data (name only) as a failover? Other issue I found is that the name and number is not enough to stop duplicates being made?

Ideally the API really should search for subcontacts... any ideas?
I'm not sure to completely understand the issue... Maybe you can provide sample JSON responses of the lookup scenario so we can see what you need and what you have? I don't know the API of your CRM, so I can't give proper advise on that side...

Also, from the 3CX side, please note that the contact lookup is triggered for both inbound and outbound calls, and this can't be disabled. In addition, you don't have any variable to determine the call type during contact lookup...
 
How do we tell the integration what scenario is the lookup? My test template for another CRM (made with the wizard) goes directly to creation, it doesn't do the lookup and I confirmed that my API is working properly.
 
https://api-docs.syncromsp.com/#/ shows all demo api data :)

customers returns (based on query of the number)

JSON:
{
  "customers": [
    {
      "id": 1,
      "firstname": "Walkin",
      "lastname": "Customer",
      "fullname": "Walkin Customer",
      "business_name": null,
      "email": "[email protected]",
      "phone": "123",
      "mobile": null,
      "created_at": "2019-10-21T01:33:21.053-07:00",
      "updated_at": "2019-10-21T01:33:21.053-07:00",
      "pdf_url": null,
      "address": null,
      "address_2": null,
      "city": null,
      "state": null,
      "zip": null,
      "latitude": null,
      "longitude": null,
      "notes": null,
      "get_sms": false,
      "opt_out": false,
      "disabled": false,
      "no_email": true,
      "location_name": null,
      "location_id": null,
      "properties": {},
      "online_profile_url": "http://testsubdomainwi1.lvh.me//my_profile/v2/index?portal_key=81lcr4ua1parftzvbgk9",
      "tax_rate_id": null,
      "notification_email": null,
      "invoice_cc_emails": null,
      "invoice_term_id": null,
      "referred_by": null,
      "ref_customer_id": null,
      "business_and_full_name": "Walkin Customer",
      "business_then_name": "Walkin Customer",
      "contacts": []
    }
  ],
  "meta": {
    "total_pages": 1,
    "total_entries": 1,
    "per_page": 100,
    "page": 1
  }
}

And callerid (which is also used to report calls)

JSON:
{
  "data": {
    "name": "Walking Customer",
    "ticket_status": "Open"
  }
}
 
How do we tell the integration what scenario is the lookup? My test template for another CRM (made with the wizard) goes directly to creation, it doesn't do the lookup and I confirmed that my API is working properly.
The lookup scenarios are the ones having empty IDs.
 
  • Like
Reactions: Evolute IT
https://api-docs.syncromsp.com/#/ shows all demo api data :)

customers returns (based on query of the number)

JSON:
{
"customers": [
{
"id": 1,
"firstname": "Walkin",
"lastname": "Customer",
"fullname": "Walkin Customer",
"business_name": null,
"email": "[email protected]",
"phone": "123",
"mobile": null,
"created_at": "2019-10-21T01:33:21.053-07:00",
"updated_at": "2019-10-21T01:33:21.053-07:00",
"pdf_url": null,
"address": null,
"address_2": null,
"city": null,
"state": null,
"zip": null,
"latitude": null,
"longitude": null,
"notes": null,
"get_sms": false,
"opt_out": false,
"disabled": false,
"no_email": true,
"location_name": null,
"location_id": null,
"properties": {},
"online_profile_url": "http://testsubdomainwi1.lvh.me//my_profile/v2/index?portal_key=81lcr4ua1parftzvbgk9",
"tax_rate_id": null,
"notification_email": null,
"invoice_cc_emails": null,
"invoice_term_id": null,
"referred_by": null,
"ref_customer_id": null,
"business_and_full_name": "Walkin Customer",
"business_then_name": "Walkin Customer",
"contacts": []
}
],
"meta": {
"total_pages": 1,
"total_entries": 1,
"per_page": 100,
"page": 1
}
}
And callerid (which is also used to report calls)

JSON:
{
"data": {
"name": "Walking Customer",
"ticket_status": "Open"
}
}
Let me see if I get this straight. You have it working with the customers query, but you prefer using the callerid method instead? And the problem is that you don't have all the other details that you need to provide a valid response to 3CX?
 
The lookup scenarios are the ones having empty IDs.
Then fix the wizard. It created the template with the scenario ID "ContactLookup".
 
Then fix the wizard. It created the template with the scenario ID "ContactLookup".
Just tested this, and the wizard creates scenarios with empty IDs for contact lookup. Maybe you edited it afterwards...
 
Just tested this, and the wizard creates scenarios with empty IDs for contact lookup. Maybe you edited it afterwards...
Hmm, I don't think so but it's odd. Why can't we name it and have a way of choosing which one is the right scenario?
 
Hmm, I don't think so but it's odd. Why can't we name it and have a way of choosing which one is the right scenario?
That's how it works. All the scenarios with an empty ID are considered lookup scenarios, and they're all executed when 3CX needs to perform the contact lookup.

You can name scenarios for other purposes: authentication, call journaling, contact creation, chain scenarios to execute multiple requests during a contact lookup, and so on.
 
  • Like
Reactions: Evolute IT
  • Like
Reactions: Evolute IT
Let me see if I get this straight. You have it working with the customers query, but you prefer using the callerid method instead? And the problem is that you don't have all the other details that you need to provide a valid response to 3CX?

Hey

So they designed it so the callerid was the only lookup source which returns name and ticket status if any. Not designed to be stored in an address book like 3CX. This wouldn’t work as we need a contact url as a primary key in 3CX?
 
Hey

So they designed it so the callerid was the only lookup source which returns name and ticket status if any. Not designed to be stored in an address book like 3CX. This wouldn’t work as we need a contact url as a primary key in 3CX?
Yes, you need the full information, so only invoking the callerid method is not enough from the 3CX perspective. However, if you need that information, and can complete it with the information taken from the customers query, you can execute 2 scenarios in sequence. For example, you first invoke the callerid scenario, and then you set the output to a new scenario. You can check an example on how to do this in the Salesforce template, where we query Salesforce to get the customer details which returns among other details a company ID, and then we do a second query to get the company name based on the company ID. Not sure if this will solve your issue, but that's a possibility.
 
  • Like
Reactions: stressless
Status
Not open for further replies.

Forum statistics

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