Guide to the LiveAPI System
Posted by Allura on 06 02 2019.
A Brief Introduction to the LiveAPI System
The LiveAPI System is known for providing environments for various applications in the cPanel interface. Every other environment provides a way for the user’s code for interacting locally with the cPanel binary, that being cpsrvd. This permits users to make cPanel API 1, cPanel API 2 and the UAPI function calls through the socket.
Following things ought to be kept in mind:
- Every LiveAPI class provides ordinary elements for integrating with cPanel and WHM.
- The authenticated user executes all the functions once the user starts using the environments. Owing to this, various calls may fail in case the authenticated user does not have sufficient permissions.
However, it is important to note that one cannot use the LiveAPI system for calling WHM API 0 or WHM API 1 functions. Just for information, cPanel and WHM version 11.28 and earlier would use the LivePHP system initially. This system used to provide similar functionality, yet was specific to the PHP programming language.
Knowing the LiveAPI Environments
CPanel and WHM offer two classes for the LiveAPI system. They have been mentioned below:
- The LiveAPI PHP Class- Environments for PHP applications are provided by the LiveAPI PHP Class.
- The LiveAPI Perl Module- An environment for Perl applications are provided by the LiveAPI Perl Module.
Even though cPanel does not provide classes for them, yet the LiveAPI system supports the following languages:
- Various other languages via the custom CGI wrappers.
A user can use CGI with the LiveAPI Perl module. The conditions state that the user should own CGI scripts and these scripts ought to have 0755 file permissions.
Requirements for the LiveAPI System
Following requirements ought to be met by applications that make use of the LiveAPI system:
- The code ought to include the appropriate environments and instantiate the class’s respective object.
- File names should be ending with the appropriate file extensions as mentioned below
- PHP – .livephp or .live.php
- Perl – .livepl or .live.pl
- Ruby – .liverb or .live.rb
- Python – .livepy or .live.py
- CGI – .livecgi or .live.cgi
- Files and symlinks to the provided relevant files should exist in the / usr / local / cPanel / base / frontend / theme / directory. Here, theme is always the cPanel theme, i.e., paper lantern.