i-MSCP - REST server - Web Services - Question for end users

  • Hello community ;


    Introduction


    In next release, I'll introduce a REST server that will allow any developer/contributor to provide plugins that act as web service controller. That will allow communication between i-MSCP and external applications such as BoxBilling, WHMCS but also any cms and so on... The REST server alone will do nothing but if someone develop a plugin that provides such Web service, he will be able to use the REST server to handle the incoming requests.


    Usage example


    For instance, many resellers have their own sites for Web Hosting, and sometime, some of them want add a little form on their site to allow the new customers to subscribe a hosting plan or allow direct registration without reseller confirmation. For now, it's only possible to subscribe a hosting plan via the i-MSCP order panel interface.


    With the REST server, the reseller will be able to code a plugin for i-MSCP that will be able to talk with its site and process the user subscription (order) or direct registration without confirmation.


    To resume (in few lines)


    For the i-MSCP side, the reseller will have to create a little plugin that listens on the onRestRequest event and that do the needed tasks for the specified request.


    On the reseller site, the reseller will have to create a little script that implements a REST client. This client will be responsible to query the i-MSCP Web service (provided by the plugin) via the i-MSCP REST server.


    Of course, I also provides the REST client ready to use that the reseller will be able to reuse for its own application.


    Question


    Should we allow the reseller to add its own plugins (with admin's confirmation for activation) and only run them only for him (by checking a kind of token in the incoming request) or should we force the reseller to ask the admin to add its plugins and activate them?


    Since your are the users of i-MSCP, I let you give us your opinion.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Hello;


    No, it's a special script that handle REST requests such as


    Code
    1. http://i-mscp.net/rest.php?wsid=boxbilling&method=suspendAccount&arg1=1


    With URL rewriting


    Code
    1. http://i-mscp.net/boxbilling/rest?&method=suspendAccount&arg1=1


    So here the web service is BoxBilling (plugin BoxBilling that provide Web service controller) and the method called by external application is suspendAccount() with 1 passed as argument.


    It's only a little not working example.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • It's also my opinion Sasha. ;) For the first proposition, that means that we must provide a restricted API to avoid the reseller to do all they want with core code. I'll provide such restricted API via a plugin later.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206