The API is still pretty new and needs some serious cleaning up on the backend but should be reasonably functional. There are no error codes yet.
The API endpoint is http://ip:port + HTTP_ROOT + /api?apikey=$apikey&cmd=$command
Response example
{
"response": {
"data": [
{
"loglevel": "INFO",
"msg": "Signal 2 caught, saving and exiting...",
"thread": "MainThread",
"time": "22-sep-2015 01:42:56 "
}
],
"message": null,
"result": "success"
}
}
General parameters: out_type: 'xml', callback: 'pong', 'debug': 1
Possible params: sort='', search='', order='desc', regex='', start=0, end=0 Returns the plexpy log
Possible params: username='', password='' (required if auth is enabled) Returns the apikey
No params Returns the config file
No params Returns some version information: git_path, install_type, current_version, installed_version, commits_behind
possible params: user=None, user_id=None, ,rating_key='', parent_rating_key='', grandparent_rating_key='', start_date='' Returns
Required params: rating_key Returns metadata about a file
Possible params: machine_id=None, user_id=None, Returns
Possible params: user_id=None, user=None
Possible params: time_range=30, y_axis='plays', playtype='total_plays_per_month'
Updates the version information above and returns getVersion data
No params Shut down plexpy
No params Restart plexpy
No params Update plexpy - you may want to check the install type in get version and not allow this if type==exe