CRM integration

Status
Not open for further replies.

Ricavir

Joined
Apr 16, 2018
Messages
7
Reaction score
0
Hi,

I'm currently trying to configure my 3CX server to communicate with a CRM REST API.
I'm a developer. I've followed the steps described here https://www.3cx.com/docs/crm-integration/.

I don't manage to get access token from the CRM server (but I can do it with external tooling such as Postman).

The CRM server needs a simple Oauth authentification :
- Call URL : https://mycrm.com/api/TokenAuth/Authenticate . The call is POST with userName and Pasword wihtin body request
- Then, server sends AccessToken
- This AccessToken has to be included in every request to the API
- I also configured the matching scenario as explained

When I test with these parameters, I have an error "System.Exception: The response is empty."
If I remove Authentification, the request is sent to my CRM but result is Ok but with "unAuthorizedRequest" (as AccessToken is not present in the request).

Is there someone who can help me with this ?

Cheers
 
For OAuth authentication, please note that you need to define a scenario for that, and configure the Authentication node as "scenario" pointing to that scenario. Did you do it that way?

When you do this, the server side engine will perform the authentication before sending any request, and once it gets the Access Token, it will include it in every request. You can see the Salesforce template as an example, as it uses OAuth authentication as well.

Kind regards.
 
Thank you very much Ernesto.
Yes, this is exactly what I'm trying to do. I've followed the salesforce example.

I dug a little bit more and I found an issue on the server logs.

Actually, I'm getting an HTTP 415 error when authentification request is sent > this is because request payload is in text/plain format ! And my CRM server is waiting for application/json format.

Is it possible to change text/plain to json ?
 
Unfortunately that's not possible at the moment, but we already found this issue and we'll be adding the ability to do it in the next version of the tool. There is no ETA for this, but we'll do it as soon as possible.
 
Ok, good to know.
We will definitely wait for this update :)

Cheers
 
Hi,

Finally, I decided to change my server authentication method to accept plain/text payload format !

Now I can get my CRM records from your tool (CRM Integration Editor).

The problem now is that I only have values on "Variables" tab and nothing on "Output" tab.

I've tried my best to follow your tutorials and I don't know if I miss something important

Do you know how to solve this ?

I've attached some screeshots to provide better understanding of the problem
 

Attachments

  • output_FirstName_setting.PNG
    output_FirstName_setting.PNG
    31.4 KB · Views: 29
  • output_tab.PNG
    output_tab.PNG
    43.8 KB · Views: 27
  • response_tree_tab.PNG
    response_tree_tab.PNG
    62.1 KB · Views: 28
  • variables_tab.PNG
    variables_tab.PNG
    47.2 KB · Views: 29
Ensure that your server is returning the same phone number you're looking for in the tool. Also ensure that you output a ContactUrl field.
 
Yes, when I search for a number, the server is answering the right matching contacts. I can see records on variables tab. I aldo created a ContactUrl field in outputs node (I’ve joined a static url with an ID got from crm records).

Bit still nothing on output tab....

I don’t see what is missing here.
 
What value do you have in the "Number" field when you select the "Parameter Values" node?
 
I have tested several values. Currently, I'm testing "0679" which correpond to 3 records in my CRM.
I can see them in "Response tree" tab and in "Variables" tab which means that authentication and communication with my CRM is working.
But still nothing in "Output tab" :(
 
Try using a larger number to test. Try with the full number that 3CX would receive for a call coming from your SIP trunk. Usually that's a 10 digits or larger number...
 
You are right, by testing with a 10 digits number, I get values within "Output" tab.

Thank you Ernesto
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei