simontelephonics / smsconnector

SMS Connector module for FreePBX 16 and 17
https://simon.tel/open-source/
GNU General Public License v3.0
41 stars 16 forks source link

External API integration endpoints #12

Open goharahmed opened 1 year ago

goharahmed commented 1 year ago

Hi Bill, This is more of a feature request. We often come across a scenario where external applications need to use the freePBX graphQL or REST interface to manage extensions, their authentications or even send/receive messages, on a user's behalf. It'd be useful if your module has API endpoints exposed for the world to use. Ofcourse need to be secured and authenticated.

Following could be useful: 1 - API endpoints to send a message out on behalf of a user. 2 - API endpoint to register a webhook for incoming messages on behalf of a user. 3 - Expiration & Refreshing mechanism for Auth Tokens for the above API endpoints 4 - Expiration & Refreshing mechanism for the message delivery webhooks 5 - [Good to Have] an API endpoint to just Authenticate incoming request with user credentials. Useful in scenarios where external Apps only need to check if the incoming request is valid or not and then perform any-other Operations.

|<-Specialized services (CRM etc)->|
[Exten/User]<=======>[External App]<-------------> [SMSConnector]<----->  SMS Vendors
                       ^
                       ||
                       ||
                        v
         [Third party services] 

Currently we provide a broker interface to do pretty much everything above but its not a freePBX module rather a standalone service; like an API wrapper for the freePBX Database mainly for Authentication purposes only. With your module we can offload messaging interconnectivity as well.

|<-Specialized services (CRM etc)->|
[Exten/User]<========>[External App]<-------------> [Broker: freePBXDB]
                       ^
                       ||
                       ||
                        v
         [Third party services] + SMS Vendors

I can provide some more details if you think your mode is the right place to do this.

Thanks, Gohar

billsimon commented 1 year ago

Hi Gohar! Nice to hear from you.

I thought about this a while and think the functionality you have already implemented could be a module all of its own, an "SMS API" module. The SMS Connector provides the third-party connections to providers, your module provides the API to send/receive SMS on behalf of users without concern about what third-party provider is servicing those numbers. I'm not saying for sure that's the right approach but it's what came to mind similar to the Unix tools philosophy of having simple tools that do one thing really well and then piping them together.

Let's keep this issue open and think about it more.