3cx crm wizard

consuelo.iglesias@alhambr

Platinum Partner
Joined
Feb 4, 2025
Messages
24
Reaction score
4
Hy everybody.

I've been trying to use the 3cx crm wizard to send the call journalist to a crm through api request with json format.

I've tried to mount the body request this way :

{ "Phone" : [Number] , "Duration" : 5 , "Agent" : [Agent] , "StartDate" : "[CallStartTimeLocal]" , "EndDate" : "[CallEndTimeLocal]" , "Direction" : "[CallDirection]" , "Inbound" : "" , "Outbound" : "" , "MissedCall" : "" , "NotAnsweredOutboundCall" : "" }

Trying the wizard with Parameter Values to check if the request is well formed, I found this result:

{ "Phone" : 1234567890 , "Duration" : 5 , "Agent" : 100 , "StartDate" : "04/02/2025 10:08:45 , "EndDate" : 04/02/2025 10:13:45 , "Direction" : Inbound" , "Inbound" : "" , "Outbound" : "" , "MissedCall" : "" , "NotAnsweredOutboundCall" : "" }

The problem is the quotes on some fields disapear and this makes the request fail.

How could I avoid this problem?

Kind Regards.
 
You will need to add the quotes around the variables:
JSON:
{ "Phone" : "[Number]" , "Duration" : 5 , "Agent" : "[Agent]" , "StartDate" : "[CallStartTimeLocal]" , "EndDate" : "[CallEndTimeLocal]" , "Direction" : "[CallDirection]" , "Inbound" : "" , "Outbound" : "" , "MissedCall" : "" , "NotAnsweredOutboundCall" : "" }
 
  • Like
Reactions: pangel
Well I've made the change as you suggested

{ "Phone" : "[Number]" , "Duration" : 5 , "Agent" : "[Agent]" , "StartDate" : "[CallStartTimeLocal]" , "EndDate" : "[CallEndTimeLocal]" , "Direction" : "[CallDirection]" , "Inbound" : "" , "Outbound" : "" , "MissedCall" : "" , "NotAnsweredOutboundCall" : "" }

and I get this request

{ "Phone" : "1234567890 , "Duration" : 5 , "Agent" : 100 , "StartDate" : 04/02/2025 15:01:56 , "EndDate" : 04/02/2025 15:06:56 , "Direction" : Inbound" , "Inbound" : "" , "Outbound" : "" , "MissedCall" : "" , "NotAnsweredOutboundCall" : "" }

and of course the request is not working. This is the Exception

System.Exception: Server returned a non successful status code - HTTPStatusCode=InternalServerError - Reason=Internal Server Error - Content=<!DOCTYPE html>
<html>
<head>
<title>Se ha pasado un objeto no v&#225;lido. Se esperaba ':' o '}'. (28): { &quot;Phone&quot; : &quot;1234567890 , &quot;Duration&quot; : 5 , &quot;Agent&quot; : 100 , &nbsp;&quot;StartDate&quot; : 04/02/2025 15:01:56 , &quot;EndDate&quot; : 04/02/2025 15:06:56 , &quot;Direction&quot; : Inbound&quot; , &quot;Inbound&quot; : &quot;&quot; , &quot;Outbound&quot; : &quot;&quot; , &quot;MissedCall&quot; : &quot;&quot; , &quot;NotAnsweredOutboundCall&quot; : &quot;&quot; }</title>
 
And if I open the xml file I check the request.

<Request SkipIf="" Url="https://...//test3CX" MessagePasses="0" Message="{ &quot;Phone&quot; : &quot;[Number]&quot; , &quot;Duration&quot; : 5 , &quot;Agent&quot; : &quot;[Agent]&quot; , &quot;StartDate&quot; : &quot;[CallStartTimeLocal]&quot; , &quot;EndDate&quot; : &quot;[CallEndTimeLocal]&quot; , &quot;Direction&quot; : &quot;[CallDirection]&quot; , &quot;Inbound&quot; : &quot;&quot; , &quot;Outbound&quot; : &quot;&quot; , &quot;MissedCall&quot; : &quot;&quot; , &quot;NotAnsweredOutboundCall&quot; : &quot;&quot; }" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="PlainText" />
 
Hi. Thank you

At least the response is correctly formed right now and I can continue testing with more elaborated information in the request.

Kind regards
 
Glad I could help! ;)
 
Hi, All.

I want to post on this thread because I have a similar issue with the CRM template generator.

I have a CRM template that we created. It works when we carry out the test in 3CX, however, the template does not create a new contact in the CRM, or retrieve details from the CRM whenever there is an inbound call. The option to create a new contact is enabled in the integrations section in 3CX, but when we try to add the contact when we are on a 3CX call (choosing CRM), the record of the contact is not saved in the CRM. There must be an issue with the template but we don't know where. This is our first time using the template generator.
 

Attachments

Hi, All.

I want to post on this thread because I have a similar issue with the CRM template generator.

I have a CRM template that we created. It works when we carry out the test in 3CX, however, the template does not create a new contact in the CRM, or retrieve details from the CRM whenever there is an inbound call. The option to create a new contact is enabled in the integrations section in 3CX, but when we try to add the contact when we are on a 3CX call (choosing CRM), the record of the contact is not saved in the CRM. There must be an issue with the template but we don't know where. This is our first time using the template generator.
The CRM Wizard hasn't been updated for the latest features.

1. Change "CreateContactRecord" to "CreateContactRecordFromClient" (scenario ID.)

2. Change the "CreateContactFirstName" and last name ones to "FirstName" and "LastName" respectively.

3. Make sure you return a proper EntityId and EntityType in your lookup scenario.

Finally, put your system in verbose to test and check the logs for errors.

https://www.3cx.com/docs/crm-template-xml-description/#h.vcivldjsa1lz
 
Just a small addition, when you create a contact from the Web Client selecting the CRM checkbox, the log you need to check to see any error is the 3cxManagementConsole.log file. As for contact lookup on incoming calls, you need to check the 3cxSystemService.log file.
 
  • Like
Reactions: Evolute IT