[EntityId] not set properly after Contact Creation

Status
Not open for further replies.

rajasekaran.r

Customer
Joined
Oct 4, 2023
Messages
11
Reaction score
2
Hi Support Team,

We have integrated Zoho Desk and 3CX for one of our customers who are experiencing an issue. After a contact is created, the [EntityId] is not being set properly and is being passed as empty in the "ReportCall" scenario.

Initially, contact creation was not working.

To resolve this, I changed the scenario from <Scenario Id="CreateContactRecord" Type="REST"> to <Scenario Type="REST"> and also tried <Scenario Id="CreateContactRecordFromClient" Type="REST">.

After making these changes, contact creation started working fine. However, the [EntityId] is still being passed as empty in the "ReportCall" scenario.

I have attached the XML template file. Please review and provide an update.

Thanks,
Rajasekaran
 

Attachments

Do you see the contact URL being launched on the Web Client when a contact is created? If you don't, then probably the mapping of the JSON response to variables in the template is wrong, and that causes that the ID is not set. I don't know which is the response of the REST API for the contact creation, so I can't tell exactly. You can also enable verbose logs and check the 3cxSystemService.log file to understand what's going on....
 
Thank you for the update.

Do you see the contact URL being launched on the Web Client when a contact is created?
No, we do not want that, as we display contact details within the 3CX phone itself.

I have double-checked the XML and API responses. Please refer to the below Create Contact REST API response and advise if I am missing anything:
Response Example:
{
"lastName": "Jack",
"modifiedTime": "2016-07-26T13:11:02.000Z",
"country": "USA",
"secondaryEmail": "[email protected]",
"city": "Texas",
"description": "first priority contact",
"ownerId": "1892000000056007",
"type": "paidUser",
"title": "The contact",
"photoURL": null,
"twitter": "Hugh jack",
"isDeleted": false,
"isTrashed": false,
"street": "North street",
"createdTime": "2016-07-26T13:11:02.000Z",
"zohoCRMContact": null,
"state": "Austin",
"id": "1892000001128052",
"customerHappiness": {
"badPercentage": "0",
"okPercentage": "0",
"goodPercentage": "0"
},
"email": "[email protected]",
"zip": "123902",
"cf": {
"cf_permanentaddress": null,
"cf_lastcontactedon": null
},
"isFollowing": true,
"facebook": "hugh jack",
"mobile": "+10 2328829010",
"accountId": "1892000000052077",
"firstName": "hugh",
"isAnonymous": false,
"phone": "91020080878",
"webUrl": "https://desk.zoho.com/support/zylke...6330fb061247d9ebddaeb9d93ba74750b0284bc703b38",
"isSpam": false
}


As per the above response, we are setting the ContactId variable path properly in the CreateContact scenario.
<Scenario Id="CreateContactRecordFromClient" Type="REST">
<Variables>
<Variable Name="ContactId" Path="id">
<Filter />
</Variable>
<Variable Name="WebUrl" Path="webUrl">
<Filter />
</Variable>
</Variables>
</Scenario>
 
Well, at this point you will need to enable verbose logs, make a test call and check the 3cxSystemService.log file. In this file you will see the details of the request being sent, and the response returned. You need to check this to understand what's going on.
 
  • Like
Reactions: rajasekaran.r
Sure, I will troubleshoot with 3cxSystemService.log file and update the results.
 
What's important here is that the call will only be logged if there is a contact attached to the call. And this can only happen if:
1) The contact lookup returns a matching contact, or
2) The contact creation manages to create the contact.

In the log file you will see if this is happening or not. Also, if a contact is attached to the call, you will see the name in the 3CX Web Client, so that's a visual hint of this part working or not.
 
  • Like
Reactions: rajasekaran.r
I have enabled verbose logging and reproduced the issue, but the "create contact" scenario itself is not being triggered. I don't see any contact creation API invocation logs in the 3cxSystemService.log file. However, I can see logs for other scenarios, like ContactLookup and ReportCall. The ContactCreation API was working fine five days ago but has now stopped working. Any input on this would be helpful.

Attached is the 3cxSystemService.log file for reference.
 

Attachments

  • 3cxSystemService.log
    3cxSystemService.log
    36.8 KB · Views: 5
  • Screenshot 2024-07-08 at 8.47.05 PM.png
    Screenshot 2024-07-08 at 8.47.05 PM.png
    1.7 MB · Views: 7
You're getting an exception during contact lookup, however that shouldn't be related to this.

Are you clicking "Add contact" in the Web Client and triggering the contact creation?
 
"You're getting an exception during contact lookup, however that shouldn't be related to this".
Yes

"Are you clicking "Add contact" in the Web Client and triggering the contact creation?"
No, it will be triggered automatically from the XML template.

Would capturing network traffic be helpful ?
 
No, it will be triggered automatically from the XML template.
I don't see the chained scenario in the XML you shared. Did you make additional changes? Otherwise this will not happen....
 
  • Like
Reactions: rajasekaran.r
No, I did not make any additional changes. But it was triggered earlier based on "Enable Contact Creation" in CRM settings.
 
No, I did not make any additional changes. But it was triggered earlier based on "Enable Contact Creation" in CRM settings.
No, the scenario will not be triggered automatically. Only the scenarios having an empty Id are triggered during contact lookup. In your case, you will need to configure the Output of the contact lookup scenario, to point to the contact creation scenario. Then, your contact creation scenario should be skipped if there are matching contacts. Check this for details on how to chain scenarios:
https://www.3cx.com/docs/crm-template-xml-description/#h.gygnghdx4oa3
 
  • Like
Reactions: Evolute IT
Thanks again for the update. I will go through the link you shared and try implementing the chain scenario.
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,852
Messages
589,385
Members
164,691
Latest member
Daz1964