Dunno if something changed recently or what, but for some reason or another my API call for RescanSeries has stopped working… I did add a “url base” of /sonarr to well sonarr in the general settings a couple days ago because I have been setting up nginx but I don’t think this is what has messed it up (unless it has??)…
Whenever my command goes off I just get the error response that is well the topic name of this post…
This is my current script that is doing the API calls.
// TVDB/TMDB ID
def id = id as int
// Sonarr API Configuration
def url = new URL('http://localhost:8989')
def header = ['X-Api-Key': 'APIKEYREDACTED']
def sonarrSeriesId = new JsonSlurper()
.parseText(new URL(url, '/api/series')
.get(header)
.text)
.find {
it.tvdbId == id
}.id
println new URL(url, '/api/command').post(
JsonOutput.toJson(
[name: 'rescanSeries', seriesId: sonarrSeriesId]
).getBytes('UTF-8'),
'application/json',
header
).text
Okay so testing it it is due to the whole URL base thing, but now I’m confused on how to get it to work with the URL base thing being set…as the whole API wiki never mentions anything about if a URL base is set then to do this instead of that…
I did try to add /sonarr to def url = new URL('http://localhost:8989') so it would be like def url = new URL('http://localhost:8989/sonarr') but that didn’t seem to make a difference as it just threw the same error message as before…
things work fine with the URL base not being set on sonarr, but as soon as I add a URL base is when things break, and well I need the URL base set for my reverse proxy to work…
Is the URL that is being hit correctly including the URL Base? If Sonarr redirects the request that is missing the URL Base to include the URL Base the redirected request may not have the correct header. I think the Debug logs should log if it’s being redirected.