1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-22 02:32:51 +01:00

Convert example payloads to camel-case and add missing fields. Add link to JSON schema.

kaotik4266 2017-07-09 16:30:42 +10:00
parent f86f9c740d
commit be9386710b

@ -4,63 +4,74 @@ If you're looking to notify a web service to indicate when Sonarr has done thing
Sonarr can notify a web service using `POST` or `PUT` when new episodes are imported, renamed, or grabbed.
Parameters are passed to the web service as a JSON body
Parameters are passed to the web service as a JSON body.
Representative payloads for each event type are below. There is also a [JSON schema](https://github.com/Sonarr/Sonarr/wiki/Webhook-Schema) available.
### Example Payload ###
##### On Download/On Upgrade #####
```json
{
"EventType": "Download",
"Series": {
"Id": 2,
"Title": "Gravity Falls",
"Path": "C:\\Temp\\sonarr\\Gravity Falls",
"TvdbId": 259972
},
"Episodes": [
{
"Id": 67,
"EpisodeNumber": 14,
"SeasonNumber": 2,
"Title": "The Stanchurian Candidate",
"AirDate": "2015-08-24",
"AirDateUtc": "2015-08-25T01:30:00Z",
"Quality": "HDTV-720p",
"QualityVersion": 1,
"ReleaseGroup": null,
"SceneName": null
}
]
}
```
##### On Grab #####
```json
{
"EventType": "Grab",
"Series": {
"Id": 2,
"Title": "Gravity Falls",
"Path": "C:\\Temp\\sonarr\\Gravity Falls",
"TvdbId": 259972
"eventType": "Grab",
"series": {
"id": 2,
"title": "Gravity Falls",
"path": "C:\\Temp\\sonarr\\Gravity Falls",
"tvdbId": 259972
},
"Episodes": [
"episodes": [
{
"Id": 67,
"EpisodeNumber": 14,
"SeasonNumber": 2,
"Title": "The Stanchurian Candidate",
"AirDate": "2015-08-24",
"AirDateUtc": "2015-08-25T01:30:00Z",
"Quality": "WEBDL-1080p",
"QualityVersion": 1,
"ReleaseGroup": "iT00NZ",
"SceneName": null
"id": 67,
"episodeNumber": 14,
"seasonNumber": 2,
"title": "The Stanchurian Candidate",
"airDate": "2015-08-24",
"airDateUtc": "2015-08-25T01:30:00Z",
"quality": "HDTV-720p",
"qualityVersion": 1
}
]
],
"release": {
"quality": "HDTV-720p",
"qualityVersion": 1,
"size": 0
}
}
```
##### On Download/On Upgrade #####
```json
{
"eventType": "Download",
"series": {
"id": 2,
"title": "Gravity Falls",
"path": "C:\\Temp\\sonarr\\Gravity Falls",
"tvdbId": 259972
},
"episodes": [
{
"id": 67,
"episodeNumber": 14,
"seasonNumber": 2,
"title": "The Stanchurian Candidate",
"airDate": "2015-08-24",
"airDateUtc": "2015-08-25T01:30:00Z",
"quality": "HDTV-720p",
"qualityVersion": 1
}
],
"episodeFile": {
"id": 1181,
"relativePath": "Season 02\\Gravity Falls - s02e14.mkv",
"path": "C:\\path\\to\\file\\GravityFalls - s02e14.mkv",
"quality": "HDTV-720p",
"qualityVersion": 1
},
"isUpgrade": false
}
```
@ -68,17 +79,38 @@ Parameters are passed to the web service as a JSON body
```json
{
"EventType": "Rename",
"Series": {
"Id": 2,
"Title": "Gravity Falls",
"Path": "C:\\Temp\\sonarr\\Gravity Falls",
"TvdbId": 259972
},
"Episode": null
"eventType": "Rename",
"series": {
"id": 2,
"title": "Gravity Falls",
"path": "C:\\Temp\\sonarr\\Gravity Falls",
"tvdbId": 259972
}
}
```
##### On Test #####
```json
{
"eventType": "Test",
"series": {
"id": 1,
"title": "Test Title",
"path": "C:\\testpath",
"tvdbId": 1234
},
"episodes": [
{
"id": 123,
"episodeNumber": 1,
"seasonNumber": 1,
"title": "Test title",
"qualityVersion": 0
}
]
}
```
##### Sample/Example Apps/Usage ####