Is there a way that I can tell NzbDrone to shut down (normally) via an HTTP call (curl, etc.) via a script? I’m not web-savvy enough to figure out the URL that gets called when I click the ‘shutdown’ button.
Poked around the API section of the wiki, but didn’t find what I was looking for.
OK – Tried to figure out a command to send (and how to send it) and came up with this: http://server:8989/api/command -X POST -d ‘{“name”: “shutdown”}’ --header “X-Api-Key:blahblahblah” (note I’m calling this from a browser currently… not sure if the formatting is correct…
it asks me for a username/password… I don’t have any kind of authentication enabled, so I’m kinda confused.
You can’t call it from your browser, you need to send a POST request, you’e getting a prompt for a password because the API key was not included with the request.
You can send the command from curl or another application that supports POST.
I’m sending a POST command from a remote browser using a Chrome extension, but NZBDrone in response pops up a message asking for the username and password, though I don’t have them enabled. I’ve tried it with and without passing the API key and it makes no difference.
Here’s the POST command i’m sending: http://server/api/command -X POST -d '{“name”: “shutdown”}'
Any idea why it asks for a username/pw and how to fix that?
How are you passing the API key? drone is returning a 401 not authenticated and Chrome pops up a basic auth prompt, but its the lack of an API key or an incorrect one that causes the issue.
Using a browser extension called Postman for chrome, which sends post requests. I tried passing the API key with this command: http://server:8989/api/command -X POST -d ‘{“name”: “shutdown”}’ --header "X-Api-Key:apikey"
and I also tried sending it as a header and value, which didn’t pop up the password prompt but returned an error message saying “method not allowed”
I tried that, no error, but no shutdown either. The command I passed was: “http://server:8989/api/system/shutdown”, with the header X-Api-Key and the value is the key. Does it matter that I’m running on a mac with mono?