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
Failure to produce a key will result in the following return from the api:
- Code: Select all
error: API Key Required
And an incorrect key will return:
- Code: Select all
error: API Key Incorrect
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:
- Code: Select all
http://localhost:8080/api?mode=config&name=set_apikey&apikey=EXISTINGAPIKEY
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:
- Code: Select all
http://localhost:8080/sabnzbd/api?mode=version&output=xml
JSON:
- Code: Select all
http://localhost:8080/sabnzbd/api?mode=version&output=json
Plain Text (Versions below 0.4.9 will return 'not implemented\n'):
- Code: Select all
http://localhost:8080/sabnzbd/api?mode=version
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.




