3

I use NowSMS for my SMS provider instead of Twilio and Clickatell. NowSMS goes through a cell phone, which is flat rate pricing instead of per text. I've found documentation for twilio or clickatell, but none about the api itself. Can someone point me toward documentation for the civicrm hooks or the "add new provider" screen? I assume civicrm does http/https in and out based on some triggers or web hooks, etc, soap, rest, xml, something? I'm self hosting civicrm on wordpress on my LAN, and NowSMS server is on the same lan, no authentication required, very very easy to program via simple http get commands with two phone numbers and some text. Anyway, yes, documentation please? We've already paid for NowSMS, and we currently use it quite successfully on other projects, so we are not willing to switch, thank you. Any help appreciated!

  • This is very cool - please update this when it's done with a link to the extension? Thanks! – Jon G - Megaphone Tech Nov 21 '19 at 5:10
  • Honestly writing an extension is a bit over my head as I don't program in PHP. I was hoping I could do it with webhooks. – Jason Miller Nov 22 '19 at 15:18
  • So is that a negative on documentation on API Type, API URL, and API Parameters? – Jason Miller Jan 10 at 17:07
4

You need to write an extension (https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-module), and you can use the existing provider extensions as a template and change what you need. You can also look at other third party extensions. I wrote one recently (https://lab.civicrm.org/extensions/ringcentral), which has some maybe nonstandard things, but mostly I copied and pasted the overall structure from twilio and clickatell, e.g. https://github.com/civicrm/org.civicrm.sms.twilio/blob/master/org_civicrm_sms_twilio.php

  • Thanks.. good answer, but writing an extension is over my head. I was hoping for a way to do with only webhooks. – Jason Miller Nov 22 '19 at 15:20
0

API documentation exists - https://docs.civicrm.org/dev/en/latest/api. You might even be able to get incoming SMS without coding an extension, using either the standard REST API or with the Form Processor extension. However, you're not going to get Civi to submit a request to an external URL without an extension.

That said - CiviRules handles a significant chunk of what you're trying to do. However, there's no "submit to an external URL" action. If you were to sponsor the authorship of such an action, you could probably get quite a lot of mileage out of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.