How it works?


HostBill User API plugin enables HTTP REST API for your customers to manage their accounts from their apps/systems.

Additionally API is self-documenting, your users will have nice, comprehensive documentation of all methods that your API offers.
 


Installing module


  1. Download purchased module from clients.hostbillapp.com
  2. Upload archive contents into main HostBill directory
  3. Proceed to Settings->Module. Search and activate "User API" module.
  4. Proceed to Extras->User API - you can manage your API routes from this section
  5. It is important to set URL rewrites for API to function, depending on your web-server software
    1. Apache users
      in /api folder rename file template.htaccess to .htaccess 
    2. Nginx (including HostBill enterprise) users 
      Edit your location file (in server section, for HostBill enterprise it is /etc/nginx/locations/hostbill.conf, add 

      location @userapi {
            rewrite ^/api/(.+)$ /api/index.php?/$1 last;
        }

      Next, to main location add try_files line:

      try_files $uri $uri/ index.php @userapi;



  6. Now, restart your webserver.


Configuring routes


You can configure routes (API functions) in Adminarea->Extras->User API

Using this section, you can:


FAQ


Q: Can we customize client area templates, edit introduction text or add company logo?
A: Yes, but you will need to edit template files used by this module, located in: ./includes/modules/Other/userapi/user/

Q: I'm missing route/function XYZ, do you plan to add it?
A: Yes! Just let us know what is missing for you and we're happy to improve this plugin for you