3CX CRM Template Generator request content error

Status
Not open for further replies.

alexis.berindei

Customer
Joined
Jan 15, 2020
Messages
2
Reaction score
1
Hello all!

I'm trying to connect 3CX with Odoo by using a self developped plugin in Odoo to expose contact in order to process the contact lookup.
I build two scenarios:
- the first one is authentication (json post to given URL)
- the second is the matching scenario.

But the main problem is on authentication:
here is my request content:
{"jsonrpc":"2.0","method":"call","params":{"db":"[Database]","login":"[UserName]","password":"[Password]"}}

here is the request content build by 3CX (same things in 3CX CRM Template Generator and 3CX Server):
{"jsonrpc":"2.0","method":"call","params":{"db":"db_fake","login":"login_fake","password":"password_fake"]

The double }} is replaced by ]

Any idea ?
 

Attachments

Have you tried moving part of it? The order doesn't change anything so I would try it like this:

{"params":{"db":"[Database]","login":"[UserName]","password":"[Password]"}, "jsonrpc":"2.0","method":"call"}

See if the }} is still replaced by ] since there's no }} like this.
 
The double }} is replaced by ]
Yes, that's a standard replacement done by the CRM engine when interpreting the expressions. This is because the characters [ and ] are used to start and end a variable placeholder, so the way to change that is using {{ or }}. This is explained here:
https://www.3cx.com/docs/server-side-crm-template-xml-description/#h.2oikrv8ncny6

In your case, you should add a space, and that will fix the issue:
[B]{"jsonrpc":"2.0","method":"call","params":{"db":"[Database]","login":"[UserName]","password":"[Password]"} }[/B]
 
  • Like
Reactions: Evolute IT
Thank you very much, it's working well !

Thank you for this documentation edossantos
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,324
Messages
591,897
Members
165,476
Latest member
awan05