How to use SABnzbd Add by fileupload / addFile API call

Got a program that plays well with SABnzbd? Share it here!
Post Reply
User avatar
noice
Newbie
Newbie
Posts: 13
Joined: March 17th, 2012, 4:45 am

How to use SABnzbd Add by fileupload / addFile API call

Post by noice » April 6th, 2013, 2:02 pm

Just because I lost some time getting to know how SABnzbd "Add by fileupload" aka "addfile" works, I though it would be good to share this simple HTML script to help API users understand how this works.
The manual is unfortunately silent on this topic: http://wiki.sabnzbd.org/api#toc29

Purpose: Add by fileupload/addfile API action takes a file content in argument and download this file in SABnzbd.

Example:

Code: Select all

<form action="https://127.0.0.1:8080/sabnzbd/api" method="POST" enctype="multipart/form-data">
Mode: <input type=text name="mode" value="addfile">
Filename: <input type=text name="nzbname" value="my target folder name">
File to upload: <input type=file name="nzbfile"><br>
<!--<input type=text name="cat" value="movies"><br>-->
API key: <input type=text name="apikey" value="my api key"><br>
<input type=submit>
</form>
Note that the form must use enctype="multipart/form-data" to properly send files.

Useful links:
SABnzbd API source code: https://github.com/sabnzbd/sabnzbd/blob ... zbd/api.py

Post Reply