SuiteCRM integration problem

Status
Not open for further replies.

Sergey123

Free User
Joined
Jul 18, 2019
Messages
13
Reaction score
2
Hi. I have created template and it works fine. But i getting this message - CRM Integration is working OK but contact number does not exist. Check log for more info or try a different number. Even if i write number that is in crm and it's showing me account with all information. What can be a problem?
 
The template needs to return a valid contact for the phone number being searched. So, at least one phone field from the output needs to have the phone number, otherwise the contact record is skipped. Also, you need to return at least a part of the name (first name, last name or company name), otherwise the record is skipped. And finally, you need to return a unique Contact URL.

Please ensure that your template is returning all that. If you're not sure, copy the full text from the Logs window when you test a call, and paste it here so we can take a look.
 
Hi. Thanks for fast answer. Here are the copy of logs:

Please enter a phone number to search in CRM
123456
CRM Integration is working OK but contact number does not exist. Check log for more info or try a different number.
Started scenario with empty id
Started Auth
Request text: http://suite/Api/access_token
Request form value grant_type set to client_credentials
Request form value client_id set to affe48ef-3330-6207-4137-5d26e4fe9003
Request form value client_secret set to client_secret
Response text: {"token_type":"Bearer","expires_in":3600,"access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjI3ODRmY2QwODE1NzhjMzQzNzdiZDQyZTJiMWUwNjY1YjkxNTA4MjVmNWU4ZTE4YWQ5MmI5NTlhNTA0MWFjMDYyNzY5ZWVmMTAxOTZjNjRmIn0.eyJhdWQiOiJhZmZlNDhlZi0zMzMwLTYyMDctNDEzNy01ZDI2ZTRmZTkwMDMiLCJqdGkiOiIyNzg0ZmNkMDgxNTc4YzM0Mzc3YmQ0MmUyYjFlMDY2NWI5MTUwODI1ZjVlOGUxOGFkOTJiOTU5YTUwNDFhYzA2Mjc2OWVlZjEwMTk2YzY0ZiIsImlhdCI6MTU2NDU1NzcyMywibmJmIjoxNTY0NTU3NzIzLCJleHAiOjE1NjQ1NjEzMjMsInN1YiI6IiIsInNjb3BlcyI6W119.1gsA2d481Q0U8WyFXlxWDtCMrgxGtzZKCByhWyWq4z3AAWxmgj2rsvNCWJRZcPbI8nfsdO6UNkfklOK_4_VEefUpW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
Request text: http://suite/API/V8/module/Accounts?filter[phone_office][eq]=123456
Response text: {
"data": [
{
"type": "Account",
"id": "ab5627f2-2884-64be-0606-5ca5c8cdb720",
"attributes": {
"name": "Test",
"date_entered": "2019-04-04T09:05:00+03:00",
"date_modified": "2019-07-24T15:37:00+03:00",
"modified_user_id": "1",
"modified_by_name": "admin",
"created_by": "1",
"created_by_name": "admin",
"description": "",
"deleted": "0",
"created_by_link": "",
"modified_user_link": "",
"assigned_user_id": "1",
"assigned_user_name": "admin",
"assigned_user_link": "",
"SecurityGroups": "",
"account_type": "",
"industry": "",
"annual_revenue": "",
"phone_fax": "",
"billing_address_street": "",
"billing_address_street_2": "",
"billing_address_street_3": "",
"billing_address_street_4": "",
"billing_address_city": "",
"billing_address_state": "",
"billing_address_postalcode": "",
"billing_address_country": "",
"rating": "",
"phone_office": "123456",
"phone_alternate": "",
"website": "http://",
"ownership": "",
"employees": "",
"ticker_symbol": "",
"shipping_address_street": "",
"shipping_address_street_2": "",
"shipping_address_street_3": "",
"shipping_address_street_4": "",
"shipping_address_city": "",
"shipping_address_state": "",
"shipping_address_postalcode": "",
"shipping_address_country": "",
"email1": "",
"email_addresses_primary": "",
"email_addresses": "",
"email_addresses_non_primary": "",
"parent_id": "",
"sic_code": "",
"parent_name": "",
"members": "",
"member_of": "",
"email_opt_out": "",
"invalid_email": "",
"cases": "",
"email": "",
"tasks": "",
"notes": "",
"meetings": "",
"calls": "",
"emails": "",
"documents": "",
"bugs": "",
"contacts": "",
"opportunities": "",
"project": "",
"leads": "",
"campaigns": "",
"campaign_accounts": "",
"campaign_id": "",
"campaign_name": "",
"prospect_lists": "",
"aos_quotes": "",
"aos_invoices": "",
"aos_contracts": "",
"jjwg_maps_address_c": "",
"jjwg_maps_geocode_status_c": "",
"jjwg_maps_lat_c": 0,
"jjwg_maps_lng_c": 0
},
"relationships": {
"AOS_Contracts": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/aos_contracts"
}
},
"AOS_Invoices": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/aos_invoices"
}
},
"AOS_Quotes": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/aos_quotes"
}
},
"Accounts": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/member_of"
}
},
"Bugs": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/bugs"
}
},
"Calls": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/calls"
}
},
"CampaignLog": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/campaigns"
}
},
"Cases": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/cases"
}
},
"Contacts": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/contacts"
}
},
"Emails": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/emails"
}
},
"Leads": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/leads"
}
},
"Meetings": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/meetings"
}
},
"Notes": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/notes"
}
},
"Opportunities": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/opportunities"
}
},
"Project": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/project"
}
},
"ProspectLists": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/prospect_lists"
}
},
"SecurityGroups": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/SecurityGroups"
}
},
"Tasks": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/tasks"
}
},
"Users": {
"links": {
"related": "V8/module/Accounts/ab5627f2-2884-64be-0606-5ca5c8cdb720/relationships/modified_user_link"
}
}
}
}
]
}
Response finished
Finished scenario with empty id

TEST
 
The CRM response contains the data, but you're not mapping the values to variables and outputs. Can you share your template so we can check what you're doing wrong?
 
I see. How do i need to mapping them? Here is mine template:
Code:
<?xml version="1.0"?>

-<Crm Version="1" Name="trolol" Country="US" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<Number MaxLength="[MaxLength]" Prefix="AsIs"/>

<Connection MaxConcurrentRequests="2"/>


-<Parameters>

<Parameter Name="ClientId" Title="Client ID:" Editor="String" Parent="General Configuration" Type="String"/>

<Parameter Name="ClientSecret" Title="Client Secret:" Editor="String" Parent="General Configuration" Type="String"/>

<!-- <Parameter Name="Client Credentials" Type="OAuth" Parent="General Configuration" Editor="String" Title="Refresh Token:" RequestUrl="http://suite/Api/V8/OAuth2" RequestUrlParameters="response_type=code&amp;client_id=[ClientId]&amp;redirect_uri=[RedirectUri]&amp;state=[State]" ResponseScenario="OAuthGetRefreshToken" /> -->


</Parameters>


-<Authentication Type="Scenario">

<Value>Auth</Value>

</Authentication>


-<Scenarios>


-<Scenario Type="REST" Id="Auth">


-<Request ResponseType="Json" RequestType="Post" RequestEncoding="UrlEncoded" RequestContentType="application/x-www-form-urlencoded" MessagePasses="0" Url="http://suite/Api/access_token">


-<PostValues>

<!-- <Value Key="client_credentials" Passes="0" Type="String">[Client Credentials]</Value> -->


<Value Type="String" Passes="0" Key="grant_type">client_credentials</Value>

<Value Type="String" Passes="0" Key="client_id">[ClientId]</Value>

<Value Type="String" Passes="0" Key="client_secret">[ClientSecret]</Value>

</PostValues>

</Request>


-<Rules>

<Rule Type="Any">access_token</Rule>

</Rules>


-<Variables>


-<Variable Name="AccessToken" Path="access_token">

<Filter/>

</Variable>


-<Variable Name="ExpiresIn" Path="expires_in">

<Filter/>

</Variable>

</Variables>


-<Outputs AllowEmpty="false">

<Output Type="HeaderName" Passes="0" Value="Authorization"/>

<Output Type="HeaderValue" Passes="0" Value="Bearer [AccessToken]"/>

<Output Type="BearerExpiration" Passes="0" Value="[ExpiresIn]"/>

</Outputs>

</Scenario>


-<Scenario Type="REST" Id="OAuthGetRefreshToken">


-<Request ResponseType="Json" RequestType="Post" RequestEncoding="UrlEncoded" RequestContentType="application/x-www-form-urlencoded" MessagePasses="0" Url="http://suite/Api/access_token">


-<PostValues>

<Value Type="String" Passes="0" Key="code">[code]</Value>

<Value Type="String" Passes="0" Key="grant_type">client_credentials</Value>

<Value Type="String" Passes="0" Key="client_id">[ClientId]</Value>

<Value Type="String" Passes="0" Key="client_secret">[ClientSecret]</Value>

<Value Type="String" Passes="0" Key="redirect_uri">[RedirectUri]</Value>

<Value Type="String" Passes="0" Key="state">[state]</Value>

</PostValues>

</Request>


-<Rules>

<Rule Type="Any">refresh_token</Rule>

</Rules>


-<Variables>


-<Variable Name="Result" Path="refresh_token">

<Filter/>

</Variable>

</Variables>


-<Outputs AllowEmpty="false">

<Output Type="Result" Passes="0" Value="[Result]"/>

</Outputs>

</Scenario>


-<Scenario Type="REST" Id="">

<Request ResponseType="Json" RequestType="Get" RequestEncoding="UrlEncoded" MessagePasses="0" Url="http://suite/API/V8/module/Accounts?filter{{phone_office}}{{eq}}=[Number]" SkipIf=""/>


-<Rules>

<Rule Type="Any">accounts.id</Rule>

</Rules>


-<Variables>


-<Variable Name="ContactID" Path="accounts.id">

<Filter/>

</Variable>


-<Variable Name="FirstName" Path="accounts.name">

<Filter/>

</Variable>


-<Variable Name="PhoneBusiness" Path="accounts.phone_office">

<Filter/>

</Variable>

</Variables>


-<Outputs AllowEmpty="false">

<Output Type="ContactID" Passes="0" Value="[ContactID]"/>

<Output Type="FirstName" Passes="0" Value="[FirstName]"/>

<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]"/>

<Output Type="ContactUrl" Passes="0" Value="http://suite/API/V8/module/Accounts/?=name,phone_office"/>

</Outputs>

</Scenario>

</Scenarios>

</Crm>
 
Hi. I finally did it. Now it works fine) Other question how can i test call locally, to see how it will work if Client calls?
 
Other question how can i test call locally, to see how it will work if Client calls?
Only calls from or to external numbers are considered for CRM integration. Internal calls will not start the CRM engine.

You will need to test with real calls from external numbers, or emulate the calls using the CRM Tool.
 
Can i in 3cx web client (console) test not only the finding write number but opening crm profile account in web browser?
 
Can i in 3cx web client (console) test not only the finding write number but opening crm profile account in web browser?
You need to make a real call to test this.
 
Hi Sergey,
can you share your template pls?
 
Yes. Enjoy. Soon i will finish making online template creator for 3CX
 

Attachments

I just wondering did mine template work for you ?
 
I didnt had time to try it yet but wil keep you in touch when I do.
 
What can be the problem in open Url after crm integration? In template generator everything is reterning normal. But when i make a call nothing happens.
 
Enable verbose logs from the 3CX Console > Dashboard > Activity Log > Settings. Then make a test call and check the 3cxSystemService.log file.
 
I made calls and look on log 3cxSystemService.log, find some info about the call, but what exactly i must look for ?
 
If i don't find any mathion about CRM integration in log? What can be the problem? If Server side is ok, integration ok and it's finding write number and all info about it in test.
 
Silly question, but are you using the Web Client when you receive the call? The popup is launched by the Web Client. Also, check if the browser is not blocking popups from the Web Client.
 
Status
Not open for further replies.

Forum statistics

Threads
112,320
Messages
591,865
Members
165,463
Latest member
ICTSupport@bedfordgirlssc