openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 16.1 kB
JSON
{"openapi":"3.0.0","info":{"contact":{"x-twitter":"Spinitron"},"description":"Maximum limit is 200. Default limit is 20.","title":"Spinitron v2","version":"1.0.0","x-apisguru-categories":["media"],"x-logo":{"url":"https://twitter.com/Spinitron/profile_image?size=original"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/spinitron/v2api/master/spinitron.yaml","version":"2.0"}],"x-providerName":"spinitron.com"},"tags":[{"name":"Persona"},{"name":"Show"},{"name":"Playlist"},{"name":"Spin"}],"paths":{"/personas":{"get":{"parameters":[{"description":"Filter by Persona name","in":"query","name":"name","schema":{"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The personas","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Persona"},"type":"array"}},"type":"object"}]}},"application/xml":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Persona"},"type":"array"}},"type":"object"}]}}}}},"security":[{"Bearer":[]}],"summary":"Get Personas","tags":["Persona"]}},"/personas/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The Persona","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Persona"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Persona"}}}},"404":{"description":"Persona not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Get Persona by id","tags":["Persona"]}},"/playlists":{"get":{"description":"Get Playlists optionally filtered by a datetime range.\nOnly past Playlists will be returned (with allowed tolerance equals 1 hour in future).\n\nOrdered chronologically from newest to oldest.\n","parameters":[{"description":"The datetime starting from items must be returned. Maximum 1 hour in future.\n","in":"query","name":"start","schema":{"type":"string","format":"date-time"}},{"description":"The ending datetime. Maximum 1 hour in future.\n","in":"query","name":"end","schema":{"type":"string","format":"date-time"}},{"description":"Filter by show","in":"query","name":"show_id","schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The playlists","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Playlist"},"type":"array"}},"type":"object"}]}},"application/xml":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Playlist"},"type":"array"}},"type":"object"}]}}}}},"security":[{"Bearer":[]}],"summary":"Returns playlists optionally filtered by {start} and/or {end} datetimes","tags":["Playlist"]}},"/playlists/{id}":{"get":{"description":"The response object represents the playlist specified by {id}.\n\nStatus 404 is returned if a playlist with {id} does not exist or if it does but starts in the future (with allowed tolerance equals 1 hour in future).\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The playlist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playlist"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Playlist"}}}},"404":{"description":"Playlist not found or is in the future","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Get a Playlist by id","tags":["Playlist"]}},"/shows":{"get":{"description":"**Terminology**: Spinitron defines a *show* as a radio program. A show can have one or more *schedules*,\neach of which may specify either an *occurence* or a *repetition*, which represents a set of occurences.\nThus scheduled shows have occurences that, for example, may be displayed in a calendar.\n\nIn the response, `items` is an array of objects representing occurences of scheduled shows.\n\nYou may optionally filter `items` to a datetime *range* by including in the request {start} and/or {end}\nparameters, both of which must be no more than one hour in the past. An occurence starting at {end} is\nincluded in the reponse.\n\n`itmes` can include occurences that begin *or* end within the filter range. A show that goes on air before\n{start} appears in `items` if it ends *after* but not *at* {start}. An occurence starting at or before {end}\nis included.\n\nIf the request omits the {start} parameter, the server sets its value to the current time so that the filter\nrange's start is always defined. If the request specifies {end} then the requested range is *bounded*,\notherwise it is *unbounded*.\n\nFor a bounded request, `items` includes *every* occurence of all shows occuring in the range. The only\ndifference between objects in `items` representing a given show will be the `start` field value.\n\nFor an unbounded request, `items` includes *only one* occurence per show, specifically, the\nnext occurrence after {start} of all shows occuring after {start}.\n\nUse an unbounded request to get a straight list all shows. Use a bounded request to get a calendar/agenda\nof shows expanded into occurrences by thir shedules and repetitions.\n\nObjects in `items` are ordered first by `datetime` and then by `id`.\n","parameters":[{"description":"The datetime starting from items must be returned. Maximum 1 hour in past.\n","in":"query","name":"start","schema":{"type":"string","format":"date-time"}},{"description":"The ending datetime. Maximum 1 hour in past.\n","in":"query","name":"end","schema":{"type":"string","format":"date-time"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The shows","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Show"},"type":"array"}},"type":"object"}]}},"application/xml":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Show"},"type":"array"}},"type":"object"}]}}}},"422":{"description":"Invalid datetimes in filter: either too old or {end} is less than {start}.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Returns scheduled shows optionally filtered by {start} and/or {end} datetimes","tags":["Show"]}},"/shows/{id}":{"get":{"description":"The response object represents the next occurence of the show specified by {id}.\n\nStatus 404 is returned if a show with {id} does not exist or if it does but all its scheduled occurences elapsed in the past.\n","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The Show","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Show"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Show"}}}},"404":{"description":"Show not found or too old","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Get a Show by id","tags":["Show"]}},"/spins":{"get":{"description":"Get Spins optionally filtered by a datetime range. Only past Spins will be returned.\n","parameters":[{"description":"The datetime starting from items must be returned.\n","in":"query","name":"start","schema":{"type":"string","format":"date-time"}},{"description":"The ending datetime.\n","in":"query","name":"end","schema":{"type":"string","format":"date-time"}},{"description":"Filter by playlist","in":"query","name":"playlist_id","schema":{"type":"integer"}},{"description":"Filter by show","in":"query","name":"show_id","schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/page"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The spins","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Spin"},"type":"array"}},"type":"object"}]}},"application/xml":{"schema":{"allOf":[{"$ref":"#/components/schemas/BaseIndexResponse"},{"properties":{"items":{"items":{"$ref":"#/components/schemas/Spin"},"type":"array"}},"type":"object"}]}}}}},"security":[{"Bearer":[]}],"summary":"Returns spins optionally filtered by {start} and/or {end} datetimes","tags":["Spin"]},"post":{"description":"An endpoint for automation systems to log spins into the spin table.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"live":{"description":"Only when automation params are configured with the \"Pass through\" mode.\nEnables \"live assist\" mode. Default mode is \"full automation\".\n","type":"boolean"},"start":{"type":"string","format":"date-time"},"duration":{"type":"integer"},"artist":{"type":"string"},"release":{"type":"string"},"label":{"type":"string"},"genre":{"type":"string"},"song":{"type":"string"},"composer":{"type":"string"},"isrc":{"type":"string"}},"required":["artist","song"]}}}},"responses":{"201":{"description":"The new created Spin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Spin"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Spin"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array"}},"application/xml":{"schema":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array"}}}},"default":{"description":"Failed to create the object for unknown reason.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Log a Spin","tags":["Spin"]}},"/spins/{id}":{"get":{"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/expand"}],"responses":{"200":{"description":"The spin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Spin"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Spin"}}}},"404":{"description":"Spin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"application/xml":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"Bearer":[]}],"summary":"Get a Spin by id","tags":["Spin"]}}},"servers":[{"url":"https://spinitron.com/v2/api"},{"url":"http://spinitron.com/v2/api"}],"components":{"parameters":{"expand":{"description":"Allows to select extra fields","in":"query","name":"expand","schema":{"type":"array","items":{"type":"string"}}},"fields":{"description":"Allows to select only needed fields","in":"query","name":"fields","schema":{"type":"array","items":{"type":"string"}}},"limit":{"description":"Amount of items to return","in":"query","name":"count","schema":{"type":"integer","minimum":1,"default":20}},"page":{"description":"Offset, used together with count","in":"query","name":"page","schema":{"type":"integer","minimum":1}}},"securitySchemes":{"Bearer":{"in":"header","name":"Authorization","type":"apiKey"}},"schemas":{"BaseIndexResponse":{"properties":{"_links":{"properties":{"self":{"$ref":"#/components/schemas/Link"}},"type":"object"},"_meta":{"$ref":"#/components/schemas/Pagination"}},"type":"object"},"Error":{"properties":{"code":{"type":"integer"},"message":{"type":"string"},"name":{"type":"string"},"status":{"type":"integer"},"type":{"type":"string"}},"type":"object"},"Link":{"properties":{"href":{"type":"string"}},"type":"object"},"Pagination":{"properties":{"currentPage":{"type":"integer"},"pageCount":{"type":"integer"},"perPage":{"type":"integer"},"totalCount":{"type":"integer"}},"type":"object"},"Persona":{"properties":{"_links":{"properties":{"self":{"$ref":"#/components/schemas/Link"},"shows":{"items":{"$ref":"#/components/schemas/Link"},"type":"array"}},"type":"object"},"bio":{"type":"string"},"email":{"type":"string"},"id":{"type":"integer"},"image":{"type":"string"},"name":{"type":"string"},"since":{"description":"Year","format":"integer","type":"string"},"website":{"type":"string"}},"type":"object"},"Playlist":{"properties":{"_links":{"properties":{"persona":{"$ref":"#/components/schemas/Link"},"self":{"$ref":"#/components/schemas/Link"},"show":{"$ref":"#/components/schemas/Link"},"spins":{"$ref":"#/components/schemas/Link"}},"type":"object"},"automation":{"type":"boolean"},"category":{"type":"string"},"description":{"type":"string"},"duration":{"description":"Duration in seconds","type":"integer"},"end":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"episode_description":{"type":"string"},"episode_name":{"type":"string"},"hide_dj":{"type":"boolean"},"id":{"type":"integer"},"image":{"type":"string"},"persona_id":{"type":"integer"},"show_id":{"type":"integer"},"since":{"format":"date","type":"string"},"start":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"timezone":{"example":"America/Chicago","type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"type":"object"},"Show":{"properties":{"_links":{"properties":{"personas":{"items":{"$ref":"#/components/schemas/Link"},"type":"array"},"playlists":{"$ref":"#/components/schemas/Link"},"self":{"$ref":"#/components/schemas/Link"}},"type":"object"},"category":{"type":"string"},"description":{"type":"string"},"duration":{"description":"Duration in seconds","type":"integer"},"end":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"hide_dj":{"type":"boolean"},"id":{"type":"integer"},"image":{"type":"string"},"one_off":{"type":"boolean"},"since":{"description":"Year","format":"integer","type":"string"},"start":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"timezone":{"example":"America/Chicago","type":"string"},"title":{"type":"string"},"url":{"type":"string"}},"type":"object"},"Spin":{"properties":{"_links":{"properties":{"playlist":{"$ref":"#/components/schemas/Link"},"self":{"$ref":"#/components/schemas/Link"}},"type":"object"},"artist":{"type":"string"},"composer":{"type":"string"},"duration":{"description":"Duration in seconds","type":"integer"},"end":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"genre":{"type":"string"},"id":{"type":"integer"},"isrc":{"type":"string"},"label":{"type":"string"},"note":{"type":"string"},"playlist_id":{"type":"integer"},"release":{"type":"string"},"song":{"type":"string"},"start":{"description":"UTC datetime, ISO-8601.","format":"date-time","type":"string"},"timezone":{"example":"America/Chicago","type":"string"}},"type":"object"},"ValidationError":{"properties":{"field":{"type":"string"},"message":{"type":"string"}},"type":"object"}}}}