Sonarr version (exact version): 2.0.0.4855 Mono version (if Sonarr is not running on Windows): 5.0.1.1 OS: Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-107-generic x86_64) ((Debug logs)): (Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here) Description of issue: Hi Guys, I’ve just updated to 2.0.0.4855 and now my api calls are getting the “error”: “Unauthorized” response.
I have a GO script which is making the api calls, which a friend built for me as I couldn’t figure out making the calls directly from python. (https://github.com/kgigitdev/gonarr) .
The idea is that PlexPy calls this script when an episode is watched on my Plex server, and instructs Sonarr to start searching for any missing episodes. It does so using the api/series and api/command
This has been working perfectly for months, but I noticed from the logs that after the update its no longer working.
I’ve checked the api key and it seems to match perfectly. I haven’t changed anything in any scripts. The only thing I did was update to the latest Sonarr.
That might be the issue, if it’s being redirected the POST wouldn’t complete properly, if you’re using a URL Base in Sonarr you’ll want to prefix that to /api in the api_prefix option in Gonarr I believe.
So was this because of a change on your side in the new version? Because i’ve always had the URL base set in Sonarr but never had to use it for the api. Just curious
Yeah I have no idea about GO. I’d prefer to have this all in Python but couldn’t figure out the curl command, and my mate kindly offered to build the GO script.
I’d love to have a simple python command to take care of this so that I can troubleshoot more easily in the future. Any chance of you giving me the commands to 1) Set all episodes of a specific season to monitored, 2) Search for all wanted episodes of that season?
I’ve tried to read the docs but honestly I always get stuck on the authentication bit.
Ok, I understand you guys not wanting to spoon feed each user who asks for specific commands
I think what would really help however would be if you could put some generic examples in your wiki, for common methods of accessing and performing commands of the api. I’m sure this would be highly beneficial for the community, and would prevent n00bs like me from asking for so much personalised attention. Any chance of this?
Lol taloth… I’m not that blind! I meant an example in python etc! It’s curl and json that’s got me confused and a few examples of using these API commands inside python would be awesome.
I’m not fluent with python, so I just googled ‘python rest api example’ and got a decent example. This isn’t rocket science. It’s a rest api, the authentication is a query param or http header. That’s all explained in the wiki and should be enough, if someone doesn’t know what a http header is and unable to google it, then the api is not something for him.
I’m not saying that applies to you, but I’m pointing out the expected level of expertise and know-how.
The current api docs aren’t very readable, but it’s got the pertinent information and i’m not going to invest a big chunk of my time in improving it.
Btw. use your browser developer console, coz the Sonarr UI uses the api itself.