{"apiVersion":"5.1.1","swaggerVersion":"1.1","basePath":"https://api.composer.nprstations.org/v1","resourcePath":"/episode","apis":[{"path":"/episode/{id}/publish","description":"Publish Episode","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"httpMethod":"POST","notes":"This will publish a Episode. This action will find any children for a given episode and               trigger their playlist updates. It used the 'syndicateEpisode' worker. It retruns               statistics about what will be impacted. The actual update of each episode is handled by               individual jobs submitted to the worker process. For tracking, the 'Batch' ID can be used               to find related sub jobs and their statuses.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":500,"reason":"server error "}],"nickname":"Publish-Playlist","summary":"Publish Episode","customFields":{"description":"Publish Episode","path":"/episode/{id}/publish","method":"POST","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"void"}]},{"path":"/episode","description":"Create an Episode","operations":[{"parameters":[{"name":"body","description":"Single Episode Object","dataType":"SingleEpisode","required":true,"allowMultiple":false,"paramType":"body"}],"httpMethod":"POST","notes":"Add an episode to a Program in the past.","errorResponses":[{"code":404,"reason":"SingleEpisode not found"},{"code":500,"reason":"server error "}],"nickname":"create","summary":"Create","customFields":{"description":"Create an Episode","path":"/episode","method":"POST","params":[{"name":"body","description":"Single Episode Object","dataType":"SingleEpisode","required":true,"allowMultiple":false,"paramType":"body"}],"responseClass":"SingleEpisode","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"SingleEpisode"}]},{"path":"/episode/transfer","description":"Move Playlist","operations":[{"parameters":[{"name":"from","description":"From Episode ID","dataType":"string","paramType":"query"},{"name":"to","description":"To Episode ID","dataType":"string","paramType":"query"},{"name":"force","description":"Optional - Force overwrite of target (Default: false)","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["false","true"]},"defaultValue":"false","paramType":"query"},{"name":"offset","description":"Optional - Provides an offset in minutes from the start of the program.","dataType":"number","required":false,"allowMultiple":true,"paramType":"query"}],"httpMethod":"POST","notes":"This end point provides the ability to move playlists between two episodes. This returns either a 200, 400 and a status message.","errorResponses":[{"code":500,"reason":"server error "},{"code":500,"reason":"server error No From Episode Found."},{"code":500,"reason":"server error No To Epsidoe Found."},{"code":404,"reason":"no results found No Playlist in From Episode."}],"nickname":"Transfer-Playlist","summary":"Move Playlist","customFields":{"description":"Move Playlist","path":"/episode/transfer","method":"POST","params":[{"name":"from","description":"From Episode ID","dataType":"string","paramType":"query"},{"name":"to","description":"To Episode ID","dataType":"string","paramType":"query"},{"name":"force","description":"Optional - Force overwrite of target (Default: false)","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["false","true"]},"defaultValue":"false","paramType":"query"},{"name":"offset","description":"Optional - Provides an offset in minutes from the start of the program.","dataType":"number","required":false,"allowMultiple":true,"paramType":"query"}],"preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"void"}]},{"path":"/episode/transfer","description":"Move Playlist between Episodes","operations":[{"parameters":[{"name":"from","description":"From Episode ID","dataType":"string","paramType":"query"},{"name":"to","description":"To Episode ID","dataType":"string","paramType":"query"},{"name":"offset","description":"Optional - Provides an offset in minutes from the start of the program.","dataType":"number","required":false,"allowMultiple":true,"paramType":"query"}],"httpMethod":"GET","notes":"This end point provides the ability to move playlists between two episodes. This returns either a 200, 400 and a status message.","errorResponses":[{"code":500,"reason":"server error "},{"code":500,"reason":"server error No From Episode Found"},{"code":500,"reason":"server error No To Episode Found"},{"code":404,"reason":"no results found No Playlist in From Episode."}],"nickname":"Preview-Playlist","summary":"Preview Playlist","customFields":{"description":"Move Playlist between Episodes","path":"/episode/transfer","method":"GET","params":[{"name":"from","description":"From Episode ID","dataType":"string","paramType":"query"},{"name":"to","description":"To Episode ID","dataType":"string","paramType":"query"},{"name":"offset","description":"Optional - Provides an offset in minutes from the start of the program.","dataType":"number","required":false,"allowMultiple":true,"paramType":"query"}],"preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"void"}]},{"path":"/episode/search","description":"Search Episodes","operations":[{"parameters":[{"name":"ucs","description":"UCS ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"program","description":"Program ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"recurrence","description":"Recurrence ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"start","description":"Episode Start Datestamp MM/DD/YY, YYYY-MM-DD, etc","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"end","description":"Episode End Datestamp MM/DD/YY, YYYY-MM-DD, etc","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"parentid","description":"Parent Program ID (Used for finding syndicated program episodes)","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"hasplaylist","description":"Optional - Allows for a limit based upon state of the playlit.","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","false","true"]},"defaultValue":"ignore","paramType":"query"},{"name":"limit","description":"Optional - Limit the number of records returns.","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"order","description":"Optional - Sort the resutls by date ascending or descending (default is desc).","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","asc","desc"]},"defaultValue":"ignore","paramType":"query"},{"name":"fields","description":"Experimental - List of fields to return. (Defaults to all fields). Use the keyword 'lite' to only top level values.","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"explain","description":"Experimental - Turn on the explain information. (Default Ignore).","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","true"]},"defaultValue":"ignore","paramType":"query"}],"httpMethod":"GET","notes":"This end point will return all episodes that match the search criteria.","errorResponses":[{"code":400,"reason":"invalid No Criteria","errors":[]},{"code":500,"reason":"server error "}],"nickname":"Search","summary":"Search","customFields":{"description":"Search Episodes","path":"/episode/search","method":"GET","params":[{"name":"ucs","description":"UCS ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"program","description":"Program ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"recurrence","description":"Recurrence ID","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"start","description":"Episode Start Datestamp MM/DD/YY, YYYY-MM-DD, etc","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"end","description":"Episode End Datestamp MM/DD/YY, YYYY-MM-DD, etc","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"parentid","description":"Parent Program ID (Used for finding syndicated program episodes)","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"hasplaylist","description":"Optional - Allows for a limit based upon state of the playlit.","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","false","true"]},"defaultValue":"ignore","paramType":"query"},{"name":"limit","description":"Optional - Limit the number of records returns.","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"order","description":"Optional - Sort the resutls by date ascending or descending (default is desc).","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","asc","desc"]},"defaultValue":"ignore","paramType":"query"},{"name":"fields","description":"Experimental - List of fields to return. (Defaults to all fields). Use the keyword 'lite' to only top level values.","dataType":"string","required":false,"allowMultiple":false,"paramType":"query"},{"name":"explain","description":"Experimental - Turn on the explain information. (Default Ignore).","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["ignore","true"]},"defaultValue":"ignore","paramType":"query"}],"responseClass":"List[Episode]","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"List[Episode]"}]},{"path":"/episode/{id}","description":"Get an Episode","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"part","description":"Optional - Parts to include.","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["all","detail","playlist"]},"defaultValue":"all","paramType":"query"}],"httpMethod":"GET","notes":"Returns an episode playlist.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":500,"reason":"server error "}],"nickname":"Get","summary":"Get","customFields":{"description":"Get an Episode","path":"/episode/{id}","method":"GET","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"part","description":"Optional - Parts to include.","dataType":"string","required":false,"allowMultiple":true,"allowableValues":{"valueType":"LIST","values":["all","detail","playlist"]},"defaultValue":"all","paramType":"query"}],"responseClass":"Episode","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"Episode"}]},{"path":"/episode/{id}","description":"Delete an Episode","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"httpMethod":"DELETE","notes":"Deletes an episode.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":500,"reason":"server error "}],"nickname":"Delete","summary":"Delete","customFields":{"description":"Delete an Episode","path":"/episode/{id}","method":"DELETE","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"responseClass":"Episode","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"Episode"}]},{"path":"/episode/{id}/playlist","description":"Bulk update of playlist songs.","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Array of Playlist items.","dataType":"List[PlaylistItem]","required":true,"allowMultiple":false,"paramType":"body"}],"httpMethod":"PUT","notes":"This endpoint will update the entire playlist for an episode. This is used               by the bb in the collection save for the drag and drop. This expects an array               of song models. It will completely replace the contents of the playlist for               this episode.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":404,"reason":"No Playlist Item Found not found"},{"code":500,"reason":"server error "}],"nickname":"Update-Playlist-Songs","summary":"Bulk Update Playlist","customFields":{"description":"Bulk update of playlist songs.","path":"/episode/{id}/playlist","method":"PUT","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Array of Playlist items.","dataType":"List[PlaylistItem]","required":true,"allowMultiple":false,"paramType":"body"}],"responseClass":"List[PlaylistItem]","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"List[PlaylistItem]"}]},{"path":"/episode/{id}/playlist","description":"Add to Playlist","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Song or Item Data.","dataType":"PlaylistItem","required":true,"allowMultiple":false,"paramType":"body"}],"httpMethod":"POST","notes":"Add a Song Track or Break to a playlist. This feature can accept               a song or track without or without a start time. A duration in milliseconds               is required. If no '_start_time' is provided, it will be calculated from               either the Episode Start Time or the last Song/Track in the playlist.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":500,"reason":"server error "}],"nickname":"Add-Playlist-Song","summary":"Add to Playlist","customFields":{"description":"Add to Playlist","path":"/episode/{id}/playlist","method":"POST","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Song or Item Data.","dataType":"PlaylistItem","required":true,"allowMultiple":false,"paramType":"body"}],"responseClass":"PlaylistItem","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"PlaylistItem"}]},{"path":"/episode/{id}/playlist/{item}","description":"Update a playlist item","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Playlist Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Song or Item Data","dataType":"PlaylistItem","required":true,"allowMultiple":false,"paramType":"body"}],"httpMethod":"PUT","notes":"This route provides the ability to update a specific playlist item               (song/break). The item fields are part of the body.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":404,"reason":"No Playlist Item Found not found"},{"code":500,"reason":"server error "}],"nickname":"Update-Playlist-Song","summary":"Edit Playlist Song","customFields":{"description":"Update a playlist item","path":"/episode/{id}/playlist/{item}","method":"PUT","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Playlist Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"Song or Item Data","dataType":"PlaylistItem","required":true,"allowMultiple":false,"paramType":"body"}],"responseClass":"PlaylistItem","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"PlaylistItem"}]},{"path":"/episode/{id}/playlist/{item}","description":"Remove a playlist item","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"httpMethod":"DELETE","notes":"This route will remove a specific playlist item from an episodes playlist using the playlist item id.               Note: This will not update the start times for other items in the list. User is required to find an update               the items using the update route or the bulk update route","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":404,"reason":"No Playlist Item Found not found"},{"code":500,"reason":"server error "}],"nickname":"Delete-Playlist-Song","summary":"Delete Playlist Item","customFields":{"description":"Remove a playlist item","path":"/episode/{id}/playlist/{item}","method":"DELETE","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"responseClass":"PlaylistItem","preliminaryCallbacks":[null]},"responseClass":"PlaylistItem"}]},{"path":"/episode/{id}/playlist/{item}","description":"Get a playlist item","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"httpMethod":"GET","notes":"This routes provides the ability to get an individual item from an episode playlist.","errorResponses":[{"code":400,"reason":"invalid id","errors":[]},{"code":404,"reason":"No Episode Found not found"},{"code":404,"reason":"No Playlist Item Found not found"},{"code":500,"reason":"server error "}],"nickname":"Get-Playlist-Song","summary":"Get Playlist Item","customFields":{"description":"Get a playlist item","path":"/episode/{id}/playlist/{item}","method":"GET","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"item","description":"Item ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"}],"responseClass":"PlaylistItem","preliminaryCallbacks":[null]},"responseClass":"PlaylistItem"}]},{"path":"/episode/{id}/import","description":"Upload Playlist","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"files","description":"Playlist file","dataType":"file","required":true,"allowMultiple":false,"paramType":"body","defaultValue":true},{"name":"append","description":"Optional Append Flag (Available in URl or Body)","dataType":"string","required":true,"allowMultiple":false,"allowableValues":{"valueType":"LIST","values":["false","true"]},"defaultValue":false,"paramType":"query"}],"httpMethod":"POST","notes":"This endpoint will import and process a playlist for a specific episode.","errorResponses":[{"code":404,"reason":"No episode found not found"},{"code":500,"reason":"server error "}],"nickname":"Import-Playlist-File","summary":"Import Episode Playlists","customFields":{"description":"Upload Playlist","path":"/episode/{id}/import","method":"POST","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"files","description":"Playlist file","dataType":"file","required":true,"allowMultiple":false,"paramType":"body","defaultValue":true},{"name":"append","description":"Optional Append Flag (Available in URl or Body)","dataType":"string","required":true,"allowMultiple":false,"allowableValues":{"valueType":"LIST","values":["false","true"]},"defaultValue":false,"paramType":"query"}],"responseClass":"","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"void"}]},{"path":"/episode/{id}","description":"Update an episode","operations":[{"parameters":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"EpisodeUpdate Object","dataType":"EpisodeUpdate","required":true,"allowMultiple":false,"paramType":"body"}],"httpMethod":"PUT","notes":"This endpoint will update an existing episode using a path episode ID.","errorResponses":[{"code":400,"reason":"invalid episode","errors":[]},{"code":404,"reason":"episode not found"}],"nickname":"update","summary":"Update Episode","customFields":{"description":"Update an episode","path":"/episode/{id}","method":"PUT","params":[{"name":"id","description":"Episode ID","dataType":"string","required":true,"allowMultiple":false,"paramType":"path"},{"name":"body","description":"EpisodeUpdate Object","dataType":"EpisodeUpdate","required":true,"allowMultiple":false,"paramType":"body"}],"responseClass":"Episode","preliminaryCallbacks":[null],"requestSignature":"token"},"responseClass":"Episode"}]}],"models":{"SingleEpisode":{"id":"SingleEpisode","properties":{"date":{"type":"string","description":"Date episode airs (YYYY-DD-MM)","required":true},"end":{"type":"string","description":"Time episode ends (HH:MM)","required":true},"start":{"type":"string","description":"Time episode starts (HH:MM)","required":true},"days":{"type":"string","description":"Day of week show airs","required":true},"program_id":{"type":"string","description":"Parent Program ID","required":true}}},"Episode":{"id":"Episode","properties":{"airtime":{"type":"string","description":"Array of start, end and date for when it will play.","required":true},"event_id":{"type":"string","description":"Internal Program ID.","required":true},"playlist":{"type":"string","description":"Program Description","required":false},"program_id":{"type":"string","description":"Parent Program ID","required":true},"ucs":{"type":"string","description":"Parent UCS","required":true},"program":{"type":"string","description":"Nested Program Document.","required":true}}},"PlaylistItem":{"id":"playlistitem","properties":{"_duration":{"type":"int","description":"Duration of the item/song in seconds.","required":true},"_start_time":{"type":"int"},"trackName":{"type":"string","description":"Short Track name","required":true},"artistName":{"type":"string","description":"Arist Name","required":true},"collectionName":{"type":"string","description":"Collection Name","required":false}}},"EpisodeUpdate":{"id":"episodeupdate","properties":{"episode_notes":{"type":"string","description":"Episode Notes","required":true}}}}}