Sonarr / Sonarr

Smart PVR for newsgroup and bittorrent users.
https://sonarr.tv
GNU General Public License v3.0
10.85k stars 1.42k forks source link

API string used in V3 no longer working in V4 #6308

Closed majorsl closed 10 months ago

majorsl commented 10 months ago

Is there an existing issue for this?

Current Behavior

I have a simple bash script using curl to trigger an episode scan. It was working perfectly in V3, after upgrading to V4 it fails with a "415 method not allowed." I can find no changes in the API docs that would account for this. I did find one closed issue that suggested adding the header Content Type (see below) but that solution did not work for me.

Expected Behavior

Episode to be successfully imported.

Steps To Reproduce

curl -vvvvv http://10.0.1.201:61000/api/command -X POST --header "X-Api-Key:apikeyremovedforpost" -d '{"name":"DownloadedEpisodesScan","path":"/tv/Unsorted-TV Shows/downloadedshowdirectory/","importMode":"Move"}' --header "Content-Type: application/json; charset=utf-8"

Environment

- OS: Debian 6-1-67_1
- Sonarr: 4.0.0.748
- Docker Install: Yes
- Using Reverse Proxy: no
- Browser: curl (in bash)
- Database:

What branch are you running?

Main

Trace Logs?

2024-01-05 14:30:18.8|Trace|Http|Req: 289 [POST] /api/command (from 10.0.1.203 curl/7.88.1) 2024-01-05 14:30:18.8|Trace|Http|Res: 289 [POST] /api/command: 405.MethodNotAllowed (1 ms) 2024-01-05 14:30:18.8|Debug|Api|[POST] /api/command: 405.MethodNotAllowed (1 ms)

Anything else?

No response

stevietv commented 10 months ago

your url is wrong, it needs to be /api/v3/command you were using an old API endpoint (v2) that has now been purged.

Please use one of the support channels: forums, subreddit, discord, or IRC for support/questions.

majorsl commented 10 months ago

your url is wrong, it needs to be /api/v3/command you were using an old API endpoint (v2) that has now been purged.

Thank you for that, most helpful!