IMPORTANT: New API Key Feature of 0.4.9
Posted: April 4th, 2009, 7:05 am
Version 0.4.9 of SABnzbd, which should be released sometime next week, will introduce a new API Key feature. This feature is aimed at increasing the security of API functions.
Users will find a 32 character alphanumeric key listed on the general page of the config. This key is required in all API requests made by third party programs. The key is client side, so users will be required to enter their key into third party programs that interact with the api. The key is static and will be the same throughout sessions, however the user can manually generate a new key through the web interface.
Third party scripts should make use of this key by including it in the url of the api request.
Failure to produce a key will result in the following return from the api:
And an incorrect key will return:
If you wish to allow users to generate new keys, they can be generated like so, the new key will be returned following the command:
If set, the web username and password is still required as well as the apikey. This may change in version 0.5, however for now both the api key and user/password are required.
For versions older than 0.4.9 supplying the API Key in the api request will not work, if you wish to also support older versions then you should check the current version using the API:
XML:
JSON:
Plain Text (Versions below 0.4.9 will return 'not implemented\n'):
The version check is the only api function that does not require the apikey to be passed.
If you wish to add support for 0.4.9 before it's public release, then please sign up as a release tester which should give you access to a pre-release version of 0.4.9 a few days before the final release.
If you have any questions feel free to ask in this thread.
Users will find a 32 character alphanumeric key listed on the general page of the config. This key is required in all API requests made by third party programs. The key is client side, so users will be required to enter their key into third party programs that interact with the api. The key is static and will be the same throughout sessions, however the user can manually generate a new key through the web interface.
Third party scripts should make use of this key by including it in the url of the api request.
Code: Select all
http://localhost:8080/sabnzbd/api?mode=qstatus&output=xml&apikey=711de66ca57dae90338267d05f70efe9
Code: Select all
error: API Key Required
Code: Select all
error: API Key Incorrect
Code: Select all
http://localhost:8080/api?mode=config&name=set_apikey&apikey=EXISTINGAPIKEY
For versions older than 0.4.9 supplying the API Key in the api request will not work, if you wish to also support older versions then you should check the current version using the API:
XML:
Code: Select all
http://localhost:8080/sabnzbd/api?mode=version&output=xml
Code: Select all
http://localhost:8080/sabnzbd/api?mode=version&output=json
Code: Select all
http://localhost:8080/sabnzbd/api?mode=version
If you wish to add support for 0.4.9 before it's public release, then please sign up as a release tester which should give you access to a pre-release version of 0.4.9 a few days before the final release.
If you have any questions feel free to ask in this thread.