When the Application receives a provisioning event, it connects to PortaBilling via the XML (SOAP) or JSON (REST) API to retrieve the information about the modified entity.
Connection to the XML/JSON API is provided via HTTPS.
To access the XML API, SOAP requests to PortaBilling API must be sent to the following URL: https://portabilling-web.yourdomain.com:port/soap/service/method
To access the REST API, JSON requests to PortaBilling API must be sent to the following URL: https://portabilling-web.yourdomain.com:port/rest/service/method
Replace the portabilling-web.yourdomain.com with the actual hostname of the PortaBilling web server.
Replace ‘port’ with the required port. The SOAP/JSON interface is available for administrators on port 443.
Replace ‘service’ with the API service that contains the required method (e.g., specify the Account service to manage account information.)
Replace ‘method’ with the required API method (e.g., specify get_account_info method in order to get an account record from the database.)
The Content-Type header field used with a HTTPS POST request must have one of the following values:
The body of the POST request must contain the following parameters (in JSON format):
- auth_info – the mandatory authentication information such as login-password or login-API token for the admin web interface, or a session ID.
- params – a set of method parameters (in JSON format) that depend on a method structure. Note that method parameters and their structures are the same as those in the SOAP.
Here is an example of POST request with these parameters (in JSON format):
POST /rest/Account/get_account_info HTTP/1.1
To access the PortaBilling web server, the login request must contain a pair: a user login and either the API access token or the user password for the admin web interface. Here is an example of the POST request with these parameters:
POST /rest/Session/login HTTP/1.1
The response returns the session ID value:
Please note that we strongly recommend to use the session_id for further requests. Otherwise, if you use the login-password or the API access token authentication pairs for every request, new sessions will be created and cause additional load to the database.
For more information about PortaBilling API please refer to the PortaBilling API guide.