API POST to /series failing

Im pretty sure I am doing a dumb thing somewhere but I cant see it so was searching for a pointer if anyone can help.

$body =

{
    "tvdbId":  368667,
    "title":  "Space Force",
    "qualityProfileId":  5,
    "titleSlug":  "space-force",
    "images":  [
                   {
                       "coverType":  "banner",
                       "url":  "https://artworks.thetvdb.com/banners/series/368667/banners/5ed492dd8ced5.jpg"
                   },
                   {
                       "coverType":  "poster",
                       "url":  "https://artworks.thetvdb.com/banners/series/368667/posters/5eb1e59979ab9.jpg"
                   },
                   {
                       "coverType":  "fanart",
                       "url":  "https://artworks.thetvdb.com/banners/series/368667/backgrounds/5ec3baa5d1b5e.jpg"
                   }
               ],
    "seasons":  [
                    {
                        "seasonNumber":  1,
                        "monitored":  true
                    }
                ]
}

request made via powershell

Invoke-RestMethod -Method POST -uri http://localhost:8181/api/series?apikey=$sonarrKey -body $body

Result…
The remote server returned an error: (400) Bad Request.

I assume my body is incorrect somewhere but it passes through JSON lint with no issues.

so it appears I was/am missing
path

Either path or rootFolderPath, the response should include that error though.

the Response was in the error message, I just wasnt seeing the full message until I used Postman (Thank you PowerShell).

Thanks for the reply, rootFolderPath is much more useful for what I am doing. (Grabbing the trending TV from Trakt API and adding those shows to Sonarr). Lockdown is hitting me hard :stuck_out_tongue:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.