Cannot figure out how to get a working CRM template

Status
Not open for further replies.

perfect-touch

Customer
Joined
Mar 26, 2020
Messages
167
Reaction score
37
Now, I'm not known for being an idiot! I work in IT - and this week completed a Bash script which provides group voicemail functionality that we require in 3cx.

But for the life of me, I cannot work out how to implement a connection to our CRM (CapsuleCRM). This is perhaps the last thing standing in the way of me making the complete switchover from FreePBX to 3cx - at the moment all incoming calls are coming via FreePBX for queue hosting and CRM lookups.

Has anyone out there successfully created a CRM template for CapsuleCRM they'd be willing to share?
 
The 3cxSystemService.log will show you what is being sent to the CRM. Can you check if the header has the right value from there? Please enable verbose logs first.
 
It feels so close... there is a problem authenticating when set to 'Basic'
 
I think that the problem is that you should not use Basic authentication, because in that case the value is encoded with Base64 as per the Basic auth specification (check this: https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side).

Instead, you should set the authentication to none as follows:
<Authentication Type="No" />

Then, you need to add the header to all your requests:
XML:
<Request Url="https://api.capsulecrm.com/api/v2/parties/search?q=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
    <Headers>
        <Value Key="Authorization">Bearer [APIkey]</Value>
    </Headers>
</Request>
 
  • Like
Reactions: Evolute IT
I think that the problem is that you should not use Basic authentication, because in that case the value is encoded with Base64 as per the Basic auth specification (check this: https://en.wikipedia.org/wiki/Basic_access_authentication#Client_side).

Instead, you should set the authentication to none as follows:
<Authentication Type="No" />

Then, you need to add the header to all your requests:
XML:
<Request Url="https://api.capsulecrm.com/api/v2/parties/search?q=[Number]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
    <Headers>
        <Value Key="Authorization">Bearer [APIkey]</Value>
    </Headers>
</Request>

You're very close to my personal hero! It is not looking up the entries. I'm still confused though - output is blank?

Variables tab shows:-

ContactIDparties.id81944728
FirstNameparties.firstNamexxxxxx
LastNameparties.lastNameyyyyyyyyy
PhoneBusinessparties.phoneNumbers.number
PhoneMobileparties.phoneNumbers.number07956 454 340
PhoneHomeparties.phoneNumbers.number01992 420 097
PhoneDirectparties.phoneNumbers.number
FaxBusinessparties.phoneNumbers.number

Output tab is blank other than the header row
 
  • Like
Reactions: Evolute IT
Can you paste here the updated template? Did you add the outputs for the other phone types? In the original template you pasted here you only had the output for the business phone, which is empty now. Please note that you need to generate an output having the phone number being searched, otherwise the record is discarded.
 
Emesto... thank you thank you...

I have got some output now - just need to add some other fields. You Sir, are a gentleman. Thank you for helping (well, actually DOING this for) me - with the XML changes necessary to post the custom header in, I would never have had this working by myself.
 
Status
Not open for further replies.

Forum statistics

Threads
112,325
Messages
591,898
Members
165,479
Latest member
Senergia