FreePBX | Register | Issues | Wiki | Portal | Support

CRM Webhooks not being called

freepbx
Tags: #<Tag:0x00007f749f72a6d0>

(Colin Calvert) #1

I’ve enabled the CRM trial so we can test to make sure it works for our purposes. Essentially we just want the webhook functionality. Since the webhooks are entirely undocumented (not the REST api how to set up the webhook but the data supplied by the webhook itself) we’re currently just targeting an private RequestBin instance.

The RequestBin service is accessible from the FreePBX server (using curl is successful). The webhook is setup as acknowledged by /admin/api/sangomacrm/rest/webhooks

{
    "status": true,
    "data": [
        {
            "id": "1",
            "url": "http://redacted/for/security",
            "direction": "both"
        }
    ]
}

However, the problem is the webhook URL never gets called for any incoming or outgoing calls. Under CRM API settings Send Webhooks is set to Start and End (not that it should matter for something to get called).

Any input is appreciated. I can also submit a support ticket if necessary, I just thought I would make this public for the benefit of anyone else in case it was something simple I was overlooking since I searched and didn’t find anyone else having any issues (or really even mentioning using) this feature.


(Itzik) #2

Never done this.

Did you read already the documentation? https://wiki.freepbx.org/display/FPG/REST+API


(Colin Calvert) #3

Yes. :slight_smile:


(Itzik) #4

I’m not sure where to direct you, to request documentation…


(Lorne Gaetz) #5

Quick CRM webhook primer:

  • Browse to http://postb.in and get a URL you can use for testing
  • From the bash prompt, you can structure a webhook using the test url from above with:
# curl -H "Token: <sangoma_crm_token>" -d "url=http://postb.in/<postbin_code>&direction=both" http://localhost/admin/api/sangomacrm/rest/webhooks
{"status":true,"id":{"id":"1","url":"http:\/\/postb.in\/<postbin_code>","direction":"both"}}
  • List the newly created webhook
# curl -H "Token: <sangoma_crm_token>" http://localhost:85/admin/api/sangomacrm/rest/webhooks/both
{"status":true,"data":[{"id":"1","url":"http:\/\/postb.in\/<postbin_code>","direction":"both"}]}
  • Make inbound or outbound call to trigger the webhook
  • Refresh the web page at http://postb.in/b/<postbin_code> to see the post data pushed by the webhook

edit - Major overhaul to the wiki page, so the above is superseded by browsing to:
https://wiki.freepbx.org/display/FPG/Sangoma+CRM+REST+API


Redtail CRM integration
(Colin Calvert) #6

Thanks for that information. Like I posted in the original message I’m able to get the webhook setup (and confirm it’s status with the /admin/api/sangomacrm/rest/webhooks enpoint). However the issue I’m running into is that the webhook is simply never getting called.

Just for due diligence I tried using the postb.in service listed above, instead of our similar self hosted service. It’s the same result, I can hit the service using curl on the command line from the FreePBX server (meaning it’s accessible and not somehow getting blocked) however the webhook is just never called.

At this point I’ve pretty much written all my own code to replicate the functionality but since I already have support SSHing into our server to look at the new Queue WallBoard thing I might have them look at this too since something is clearly wonky.


(Buchafwe) #7

hello @ccalvert

We are facing the same issue, did you get the solution to this ?


(Andrew Nagy) #8

Hello.

This is now fixed

sangomacrm v13.0.7
sangomacrm v14.0.2
sangomacrm v15.0.5