- 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
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]&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]&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]&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]&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]&outbound=true&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]&outbound=true&api_key=[APIkey]" MessagePasses="1" RequestContentType="application/x-www-form-urlencoded" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
<Variables />
<Outputs AllowEmpty="false" />
</Scenario>
</Scenarios>
</Crm>