CRM can you tell me what is wrong with my response?

Status
Not open for further replies.

Greg Moss

Forum User
Joined
Oct 17, 2019
Messages
5
Reaction score
0
Many thanks up front for all the assistance.

So I have a template that it says is working but get this error:

CRM Integration is working OK but contact number does not exist. Check log for more info or try a different number.

I've look at other solutions and have tried to use those troubleshooting examples but still am not having luck.

I can lookup the contact in the CRM and return back the ContactID but it just never seems like 3cx knows anything about what that ContactID means. Also, how would 3cx know that contact id exists anyway because it is in the CRM system and not in 3cx?

In the templates it looks like the create contact scenerios take a contact id. Is that the new contact id that I should put somewhere in the CRM record to tie it to the 3cx system? When I attempted to retrieve the value in the CRM there was nothing in it.

Overall I feel pretty good in understanding the template itself and there are lots of example templates the part I'm confused on is what exactly to return back and how 3cx knows what to do with the output values. Also how the contacts in the 3cx system are tied to the CRM.

I've attached the template I'm using scrubbed of url/auth info.

Finally the ReportCall scenario never seems to fire. I've made sure to check it in the template test. The URL i specify in the template never even gets called. I had read somewhere that it won't fire in the test ever and then I read somewhere else it only works if a record is found in the 3cx system. Can I get some clarification on the best way to test the logger?

All the help is appreciated. I feel like I'm getting close!

The result I'm currently getting in the test of the CRM integration tool is below:

Started scenario with empty id
Started Auth
Request text: https://os.isp.XXXXXXXXXXXXXX.com/api/authentication/oauth2/token
Request form value grant_type set to password
Request form value client_id set to xxxxxxxxxxxxxxxxxxxxxxxxxxx
Request form value client_secret set to xxxxxxxxxxxxxxxxxxxxxx
Request form value username set to [email protected]
Request form value password set to xxxx!
Response text: {"access_token": "xxxxxxxxxxxxxxxx", "expires_in": 3600, "token_type": "Bearer", "scope": "", "refresh_token": "LPrg7HxxxxxxxxxxxxxxxaTJamAWKNvb"}
Response finished
Variable AccessToken set to GCQlap7SxxsasdasdasdZDSSDSADASXXXSAA
Variable ExpiresIn set to 3600
Finished Auth
Request text: https://os.isp.XXXXXXXXXXXXXXXXXX.com/api/custom/call/contact?phone=551234
Response text: {
"endpoint": "/api/custom/call/contact",
"result": {
"CompanyName": "XXCVCVCVVV",
"ContactID": 58221,
"ContactURL": "https://os.isp.XXXXX.com/web#id=58221&action=118&model=res.partner&view_type=form&menu_id=94",
"Email": "[email protected]",
"FirstName": "J",
"LastName": "dfdsf",
"PhoneBusiness": "(304) 555-1234",
"PhoneMobile": ""
}
}
Response finished
Finished scenario with empty id
Started CreateContactRecord
Request text: https://os.isp.sdfsadfdfd/api/custom/call/create_contact?phone=555-1234
Request form value FirstName set to First Name
Request form value LastName set to Call 555-1234
Request form value Phone set to 555-1234
Response text: {
"endpoint": "/api/custom/call/create_contact",
"result": {
"ContactID": 82051,
"FirstName": "First Name",
"LastName": "Call 555-1234"
}
}
Response finished
Finished CreateContactRecord
Result obtained
 

Attachments

Hello @Greg Moss,

Call Journaling works when you match a contact, because the entry is attached to the agent and the contact. So, when you fix the lookup issue, Call Journaling should start working.

In your logs, it's weird that even if the lookup returns a valid contact with the phone number being searched, it's not accepted, and the contact creation scenario is executed. I can't spot why this is happening, you're returning the required outputs: the ContactUrl, at least one phone number having the value being searched, and at least the first name, the last name or the company name. If you return that information, the record should be accepted by 3CX. Somehow it's being discarded...

What version of 3CX are you using? Have you tested this from the CRM template tool?
 
Version # is 16.0.676. I get the same results in the CRM template tool as I do through testing online browser. I noticed in the template there is the variable name but then there is also a path as well. like for example it may have ContactID and then for path it would have id. I also want to be clear on exactly how the 3cx system maps contacts to the CRM system.

When I create the contact I'm passing back the id from the CRM system, correct? Same when I do a lookup. I lookup the record and then pass back the ContactID from the CRM. At this point it does appear as if everything is working but the call logging. I've tested it with the live system as well and it never seems to run the scenerio. Looking at a lot of different templates I just can't really see what I'm doing wrong here.
 
Regarding the version, you mean 16.0.3.676, correct?

Let me clarify a few things first. The ContactID output is just to provide the information to a chained scenario, for example, to pass this ID to the Call Journaling scenario. This ContactID is not saved in 3CX. The contact is identified in 3CX Contacts using the ContactUrl output. This field is mandatory, and must be different for every contact. If you provide the same ContactUrl for 2 different contacts, the second will override the first, because 3CX will consider that both are the same contact, and will update the details instead of creating a new one.

It would be good to have access to a testing environment, to check this out. Not sure if it's possible. Please feel free to send me the details via a private message.
 
I copied and pasted the version # just as it is from the dashboard. So the ContactID is not saved in 3CX but the message is CRM Integration is working OK but contact number does not exist. So if it is not saved in 3cx and I'm providing the contact id i'm curious where is it that the contact number does not exist? When it says it doesn't exist I assumed it was referring to something on the 3cx side as it is doing the responding.

I will follow up with a private message with credentials.
 
I copied and pasted the version # just as it is from the dashboard. So the ContactID is not saved in 3CX but the message is CRM Integration is working OK but contact number does not exist. So if it is not saved in 3cx and I'm providing the contact id i'm curious where is it that the contact number does not exist? When it says it doesn't exist I assumed it was referring to something on the 3cx side as it is doing the responding.
When the CRM returns data, this is parsed by 3CX, and the returned records might be accepted or rejected. In some cases, the CRM returns contacts that are not a real match, for example not having the phone number being searched. In that case the record is discarded. Also, if some mandatory field is missing, like the ContactUrl, the record is discarded. Only valid matches are considered.

In your case, the error message "CRM Integration is working OK but contact number does not exist" means that no valid record was matched, and then nothing is added to 3CX contacts. I checked the response, and can't figure out what's missing, the contact returned seems to be valid, but somehow it's not being accepted... I need to see this in action, that's why I need testing credentials.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,475
Latest member
lastshadow