{"openapi":"3.0.0","servers":[{"description":"API Mock","url":"https://virtserver.swaggerhub.com/drewen/ab-idolgame/1.0.0"}],"info":{"version":"1.0.0","title":"AB Idol Game API"},"tags":[{"name":"admin","description":"Secured Admin-only calls"},{"name":"room","description":"Available to panel rooms"},{"name":"idol","description":"Available to logged-in users with an idol"},{"name":"guest","description":"Available to everyone"}],"paths":{"/v1/idol":{"get":{"security":[{"idolAuth":[]}],"tags":["idol"],"summary":"responds with an idol for logged-in users","operationId":"getIdol","responses":{"200":{"description":"idol found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Idol"}}}},"401":{"description":"not logged in or could not find idol"}}}},"/v1/idol/wardrobe":{"get":{"security":[{"idolAuth":[]}],"tags":["idol"],"summary":"gets a wardrobe sprite, use query params to preview changes","operationId":"getWardrobe","parameters":[{"in":"query","name":"base","schema":{"type":"integer","example":0},"description":"The base to use"},{"in":"query","name":"hat","schema":{"type":"integer","example":3},"description":"The hat to use"},{"in":"query","name":"hair","schema":{"type":"integer","example":4},"description":"The hair to use"},{"in":"query","name":"eyes","schema":{"type":"integer","example":7},"description":"The eyes to use"},{"in":"query","name":"mouth","schema":{"type":"integer","example":3},"description":"The mouth to use"},{"in":"query","name":"top","schema":{"type":"integer","example":1},"description":"The top to use"},{"in":"query","name":"bottom","schema":{"type":"integer","example":2},"description":"The bottom to use"},{"in":"query","name":"shoes","schema":{"type":"integer","example":3},"description":"The shoes to use"},{"in":"query","name":"back","schema":{"type":"integer","example":3},"description":"The back to use"},{"in":"query","name":"hand","schema":{"type":"integer","example":5},"description":"The hand to use"}],"responses":{"200":{"description":"wardrobe updated","content":{"image/png":{"schema":{"type":"string","format":"binary","description":"idol sprite"}}}},"400":{"description":"invalid wardrobe options"},"401":{"description":"not logged in or could not find idol"}}},"put":{"security":[{"idolAuth":[]}],"tags":["idol"],"summary":"updates an idol's wardrobe","operationId":"updateWardrobe","responses":{"200":{"description":"wardrobe updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Idol"}}}},"400":{"description":"invalid wardrobe options"},"401":{"description":"not logged in or could not find idol"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Wardrobe"}}},"description":"Wardrobe options to update"}}},"/v1/idol/sprite":{"get":{"security":[{"idolAuth":[]}],"tags":["idol"],"summary":"gets my wardrobe sprite","operationId":"getSprite","responses":{"200":{"description":"found sprite","content":{"image/png":{"schema":{"type":"string","format":"binary","description":"idol sprite"}}}},"401":{"description":"not logged in or could not find idol"}}}},"/v1/idol/sprite/{idolId}":{"get":{"tags":["idol"],"summary":"gets my wardrobe sprite","operationId":"getIdolSprite","parameters":[{"in":"path","name":"idolId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"found sprite","content":{"image/png":{"schema":{"type":"string","format":"binary","description":"idol sprite"}}}},"404":{"description":"could not find idol"}}}},"/v1/idol/register":{"post":{"tags":["guest"],"summary":"creates a new idol","operationId":"createIdol","responses":{"200":{"description":"idol created","headers":{"Set-Cookie":{"schema":{"type":"string","example":"IDOLID=d290f1ee-6c54-4b01-90e6-d701748f0851; Path=/; HttpOnly"}}}},"400":{"description":"invalid idol options"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdolCreate"}}},"description":"Initial idol options"}}},"/v1/idol/recovery":{"get":{"tags":["guest"],"summary":"fetches an unusued recovery code","operationId":"recoverCode","responses":{"200":{"description":"recovery code generated","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","example":"adf4fadf323"}}}}}}}},"post":{"tags":["guest"],"summary":"recovers an existing idol","operationId":"recoverIdol","responses":{"200":{"description":"idol found","headers":{"Set-Cookie":{"schema":{"type":"string","example":"IDOLID=d290f1ee-6c54-4b01-90e6-d701748f0851; Path=/; HttpOnly"}}}},"404":{"description":"idol not found"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdolCreate"}}},"description":"Initial idol options"}}},"/v1/idol/attend/{eventId}":{"post":{"security":[{"idolAuth":[]}],"tags":["idol"],"summary":"attend an event","operationId":"attendEvent","parameters":[{"in":"path","name":"eventId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"event attended","content":{"application/json":{"schema":{"type":"object","properties":{"idol":{"$ref":"#/components/schemas/Idol"},"event":{"$ref":"#/components/schemas/Event"}}}}}},"401":{"description":"not logged in or could not find idol"},"404":{"description":"invalid attend options"}}}},"/v1/room":{"get":{"tags":["admin"],"summary":"get list of all rooms","description":"get list of all rooms","operationId":"getRooms","responses":{"200":{"description":"event found","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Room"}}}}},"404":{"description":"room or event data not found"}}}},"/v1/room/{roomId}":{"get":{"tags":["room"],"summary":"get info for the room","description":"get info for the room","operationId":"getRoom","parameters":[{"in":"path","name":"roomId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"room found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"404":{"description":"room not found"}}}},"/v1/room/{roomId}/event":{"get":{"tags":["room"],"summary":"get events data for the room","description":"list all events for room","operationId":"getRoomEvents","parameters":[{"in":"path","name":"roomId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"event found","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}},"404":{"description":"room or event data not found"}}}},"/v1/room/{roomId}/event/next":{"get":{"tags":["room"],"summary":"get next event data for the room","description":"list all events for room","operationId":"getRoomNextEvent","parameters":[{"in":"path","name":"roomId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"event found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWithIdols"}}}},"404":{"description":"room or event data not found"}}}},"/v1/room/{roomId}/event/{eventId}":{"get":{"tags":["room"],"summary":"get next event data for the room","description":"list all events for room","operationId":"getRoomEvent","parameters":[{"in":"path","name":"roomId","required":true,"schema":{"type":"string"}},{"in":"path","name":"eventId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"event found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"404":{"description":"room or event data not found"}}}},"/v1/room/{roomId}/event/{eventId}/attendance":{"get":{"tags":["room"],"summary":"get all of the idols for an event in a room - TODO determine necessary response schema","operationId":"getEventAttendees","parameters":[{"in":"path","name":"roomId","required":true,"schema":{"type":"string"}},{"in":"path","name":"eventId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"event idols found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventWithIdols"}}}},"404":{"description":"room or event data not found"}}}}},"components":{"schemas":{"Wardrobe":{"type":"object","required":["base","hat","hair","eyes","mouth","top","bottom","shoes","back","hand"],"properties":{"base":{"type":"number","example":0},"hat":{"type":"number","example":3},"hair":{"type":"number","example":4},"eyes":{"type":"number","example":7},"mouth":{"type":"number","example":2},"top":{"type":"number","example":1},"bottom":{"type":"number","example":2},"shoes":{"type":"number","example":2},"back":{"type":"number","example":3},"hand":{"type":"number","example":5}}},"Idol":{"allOf":[{"$ref":"#/components/schemas/Wardrobe"},{"type":"object","required":["id","accessories","badgeNumber","recoveryCode","name","starpower"],"properties":{"id":{"type":"string","format":"uuid","example":"d290f1ee-6c54-4b01-90e6-d701748f0851"},"badgeNumber":{"type":"string","example":1234567},"recoveryCode":{"type":"string","example":"adf4fadf323"},"name":{"type":"string","example":"Idoltastic"},"starpower":{"type":"number","example":37},"accessories":{"type":"object","properties":{"base":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"hat":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"hair":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"eyes":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"mouth":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"top":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"bottom":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"shoes":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"back":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}},"hand":{"type":"array","items":{"$ref":"#/components/schemas/IdolAccessory"}}}}}}]},"IdolCreate":{"type":"object","properties":{"badgeNumber":{"type":"string","example":1234567},"recoveryCode":{"type":"string","example":"adf4fadf323"},"name":{"type":"string","example":"Idoltastic"}}},"IdolAccessory":{"type":"object","properties":{"id":{"type":"number","example":3},"name":{"type":"string","example":"tophat"},"type":{"type":"string","enum":["base","hat","hair","eyes","mouth","top","bottom","shoes","back","hand"]},"status":{"type":"string","enum":["locked","unlocked"]},"unlock":{"type":"string","enum":["event","starpower"]},"starpower":{"type":"number","example":5},"eventId":{"type":"string","example":12345}}},"Event":{"type":"object","properties":{"id":{"type":"string","example":3071},"roomId":{"type":"string","example":1234567},"sourceEventId":{"type":"string","example":"abcde"},"name":{"type":"string","example":"My cool panel"},"start":{"type":"string","format":"date-time","example":"2022-05-27 09:30:00"},"end":{"type":"string","format":"date-time","example":"2022-05-27 10:30:00"}}},"EventWithIdols":{"allOf":[{"$ref":"#/components/schemas/Event"},{"type":"object","properties":{"idols":{"type":"array","items":{"$ref":"#/components/schemas/Idol"}}}}]},"Room":{"type":"object","properties":{"id":{"type":"string","example":3071},"name":{"type":"string","example":"Panel 311"}}}},"securitySchemes":{"idolAuth":{"type":"apiKey","in":"cookie","name":"IDOLID"}}}}