Sonarr version (exact version): 4.0.0.748 Mono version (if Sonarr is not running on Windows): OS: Windows 10 Debug logs: Description of issue: the manual import script I was using with version 3 is not working with version 4
I think it had some issues with white space in the JSON section when I was working on it so try removing whitespace in yours and see what happens. Been a few weeks since I worked on it so I don’t exactly remember.
EDIT : I forgot that I also had to declare the Content-Type as JSON to get it to work. Try adapting the example above as it is working with the “command” API endpoint.
Edit 2 : I think the issue is with the Content-Type. This is the Powershell Documentation for the Method you are using.
-ContentType
Default value is None Accepts pipeline input False Specifies the content type of the web request.
If this parameter is omitted and the request method is POST, Invoke-RestMethod sets the content type to application/x-www-form-urlencoded. Otherwise, the content type is not specified in the call.
The documentation is not good in this area so I ended up using tcpdump to capture and decode the packets on Linux and looked at the HTML coming off a browser to see the refresh series trigger coming into Sonarr. That is where I spotted the content-type as part of the API request.
Now that I go back and look at it I see it is there (now that I know what I am looking for) but to be honest, the way that it is documented I didn’t know what I was looking at. Probably more of a me problem but a simple curl example would be most useful or show us the request that was sent and not just the response in the HTML tool. Transitioning to requiring content-type declaration could have also been pointed out with an asterisk even so it is more obvious.
It still would be nice if the need for the contentType declaration was explicitly specified.
I have another script that does calendar gets where I was able to figure out that I needed to add includeSeries true to my command because includeSeries was listed in the calendar parameters.
I seem to remember that the old wiki (version 2?) included documentation for all the commands available through the command API. I don’t see any of that in the current API docs.