{"openapi":"3.0.0","servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/DVMonterosa/5GR-public-API/1.0.0"}],"info":{"description":"Public web service for 5 Gold Rings application","version":"1.0.0","title":"5GR web service API","contact":{"name":"Monterosa Productions Ltd","email":"hello@monterosa.co.uk","url":"http://monterosa.co.uk/"}},"tags":[{"name":"user","description":"Operations about user"},{"name":"leaderboard","description":"Everything about users scores and ranks"},{"name":"health","description":"Server status"}],"paths":{"/projects/{projectUUID}/users/login":{"post":{"tags":["user"],"summary":"Logs user into the system","operationId":"loginUser","requestBody":{"$ref":"#/components/requestBodies/LoginCredentials"},"parameters":[{"$ref":"#/components/parameters/ProjectUUID"}],"responses":{"200":{"$ref":"#/components/responses/RegistrationDataAndProfile"},"400":{"$ref":"#/components/responses/CustomBadRequest"},"401":{"$ref":"#/components/responses/InvalidCredentials"},"429":{"$ref":"#/components/responses/TooManyConnections"}}}},"/projects/{projectUUID}/users/sign":{"post":{"tags":["user"],"summary":"Sign user into the system with access token & refresh token","operationId":"signUser","requestBody":{"$ref":"#/components/requestBodies/SignCredentials"},"parameters":[{"$ref":"#/components/parameters/ProjectUUID"}],"responses":{"200":{"$ref":"#/components/responses/RegistrationDataAndProfile"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/projects/{projectUUID}/users/{publicId}":{"patch":{"tags":["user"],"summary":"Update user profile","operationId":"patchUser","requestBody":{"$ref":"#/components/requestBodies/UserPatch"},"parameters":[{"$ref":"#/components/parameters/ProjectUUID"},{"$ref":"#/components/parameters/UserPublicId"}],"responses":{"200":{"$ref":"#/components/responses/RegistrationDataAndProfile"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/projects/{projectUUID}/leaderboards/{leaderboardId}":{"get":{"tags":["leaderboard"],"summary":"Fetch users top by scores","operationId":"projectLeaderboard","parameters":[{"$ref":"#/components/parameters/ProjectUUID"},{"$ref":"#/components/parameters/ProjectsLeaderboardsIds"},{"$ref":"#/components/parameters/IncludeUsers"},{"$ref":"#/components/parameters/LeaderboardLimit"},{"$ref":"#/components/parameters/LeaderboardOffset"}],"responses":{"200":{"$ref":"#/components/responses/Leaderboard"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/projects/{projectUUID}/leaderboards/{leaderboardId}/users/{publicId}":{"get":{"tags":["leaderboard"],"summary":"Fetch user score and rank","operationId":"userProjectLeaderboardStatus","parameters":[{"$ref":"#/components/parameters/ProjectUUID"},{"$ref":"#/components/parameters/ProjectsLeaderboardsIds"},{"$ref":"#/components/parameters/UserPublicId"}],"responses":{"200":{"$ref":"#/components/responses/UserRankAndScore"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/projects/{projectUUID}/events/{eventUUID}/leaderboards/{leaderboardId}":{"get":{"tags":["leaderboard"],"summary":"Fetch users top by scores","operationId":"eventLeaderboard","parameters":[{"$ref":"#/components/parameters/ProjectUUID"},{"$ref":"#/components/parameters/EventUUID"},{"$ref":"#/components/parameters/EventsLeaderboardsIds"},{"$ref":"#/components/parameters/IncludeUsers"},{"$ref":"#/components/parameters/LeaderboardLimit"},{"$ref":"#/components/parameters/LeaderboardOffset"}],"responses":{"200":{"$ref":"#/components/responses/Leaderboard"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/projects/{projectUUID}/events/{eventUUID}/leaderboards/{leaderboardId}/users/{publicId}":{"get":{"tags":["leaderboard"],"summary":"Fetch user score and rank","operationId":"userEventLeaderboardStatus","parameters":[{"$ref":"#/components/parameters/ProjectUUID"},{"$ref":"#/components/parameters/EventUUID"},{"$ref":"#/components/parameters/EventsLeaderboardsIds"},{"$ref":"#/components/parameters/UserPublicId"}],"responses":{"200":{"$ref":"#/components/responses/UserRankAndScore"},"400":{"$ref":"#/components/responses/CustomBadRequest"}}}},"/{healthId}/health":{"get":{"tags":["health"],"operationId":"healthcheck","parameters":[{"$ref":"#/components/parameters/HealthId"}],"responses":{"200":{"$ref":"#/components/responses/ServerIsOk"},"500":{"$ref":"#/components/responses/ServerIsIll"}}}}},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"},"components":{"parameters":{"ProjectUUID":{"in":"path","name":"projectUUID","schema":{"type":"string","format":"uuid"},"required":true,"description":"LViS project uuid"},"EventUUID":{"in":"path","name":"eventUUID","schema":{"oneOf":[{"type":"string","format":"uuid"},{"type":"string","enum":["latest"]}]},"required":true,"description":"LViS event identifier - in uuid format or string \"latest\""},"UserPublicId":{"in":"path","name":"publicId","schema":{"type":"string"},"required":true,"description":"User public Id"},"IncludeUsers":{"in":"query","name":"include","schema":{"type":"string"},"required":false,"description":"Users public ids joined by commas"},"ProjectsLeaderboardsIds":{"in":"path","name":"leaderboardId","schema":{"type":"string","enum":["overall","weekly"]},"required":true},"EventsLeaderboardsIds":{"in":"path","name":"leaderboardId","schema":{"type":"string","enum":["overall","first_part","last_part"]},"required":true},"LeaderboardLimit":{"in":"query","name":"limit","schema":{"type":"integer","default":10,"minimum":1,"maximum":100}},"LeaderboardOffset":{"in":"query","name":"offset","schema":{"type":"integer","default":0,"minimum":0}},"HealthId":{"in":"path","name":"healthId","description":"Id for health monitoring","schema":{"type":"string","format":"id"},"required":true}},"schemas":{"Email":{"type":"string","format":"email"},"Password":{"type":"string","format":"password"},"UserPublicId":{"type":"string","format":"uuid","example":"1995a85c-ebe7-4821-81f9-2f79916d566a"},"EnmasseUserId":{"type":"string","format":"uuid","example":"1995a85c-ebe7-4821-81f9-2f79916d566a"},"EnmasseSignature":{"type":"string","description":"Signature to sign enmasse","example":"A0603264C82266FA927757BB9BDBE59E2A5DC1B7"},"DeviceId":{"type":"string","example":"ext_m_1920x1080_tsyyddt43645w5tdr"},"EnmasseTimestamp":{"type":"string","example":"1562762080","description":"Signature generations UNIX date in seconds"},"UserFirstName":{"type":"string","example":"Rowan"},"UserLastName":{"type":"string","example":"Nikolaus"},"UserRegion":{"type":"string","example":"Scotland"},"UserCity":{"type":"string","example":"Glasgow"},"Token":{"type":"string","example":"eyJraWQiOiJYaWEwamVUWHpJT29MZXpidCs0RFpJN1hGSjhVdEY1dDJ2VHM0dXNOa2RjPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI4NTQ4NzA3Ni0yZjVlLTQ3MzUtODRiYS0wYTc3N2U5ZjhhNzQiLCJldmVudF9pZCI6ImM0M2NkZGYzLTI0ZGEtNDU5NS05Mjk3LTE2Nzg0Yzg0MmRjMSIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiYXdzLmNvZ25pdG8uc2lnbmluLnVzZXIuYWRtaW4iLCJhdXRoX3RpbWUiOjE1NjI4MzkyNzksImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC5ldS13ZXN0LTEuYW1hem9uYXdzLmNvbVwvZXUtd2VzdC0xXzNVeWpvSUlNTiIsImV4cCI6MTU2Mjg0Mjg3OSwiaWF0IjoxNTYyODM5Mjc5LCJqdGkiOiI0OTAyMGVhMS04NmQyLTQ5ZjYtYTE3OC0zZDVkYWYxYzY0M2IiLCJjbGllbnRfaWQiOiIya28zN25tYjNhbTQ3MXBjb2JyZTRvOTJpNiIsInVzZXJuYW1lIjoiODU0ODcwNzYtMmY1ZS00NzM1LTg0YmEtMGE3NzdlOWY4YTc0In0.WamZsHwijWew7OZtT6A-PlYSCRAe3EMWA26cENuY_MPZKWz0HDD2y9_DXql1qgKXBDxxGMEK-iy95CsP1COIMc4SowqHJRGPMPpPwR4viLh-Pso-8ZWZmR5j-DPPn8iIbEb7QUJcH2bB6_rIsxPw-CKAgdAvhTJot0P1D-Eagl2LnlnqS_F5vHEI7QhB6NbfyeeTUCzXHkQ7j5yXOz4dtGxqU7gvwzoqDx9NXShWfkmfd8hIV_ucPO876HQ51duoKMFjzwl3vLgMAJUhr9EsnyGwK3SIqY9wtU2ECwqQuhQ5suldK4vIm1toCVURAduYTw648FQymJqTIpf0pF27Yw"},"RegistrationDataAndProfile":{"type":"object","properties":{"registration":{"$ref":"#/components/schemas/RegistrationData"},"profile":{"$ref":"#/components/schemas/Profile"}}},"Profile":{"type":"object","properties":{"public_id":{"$ref":"#/components/schemas/UserPublicId"},"first_name":{"$ref":"#/components/schemas/UserFirstName"},"last_name":{"$ref":"#/components/schemas/UserLastName"},"region":{"$ref":"#/components/schemas/UserRegion"},"city":{"$ref":"#/components/schemas/UserCity"}}},"RegistrationData":{"type":"object","properties":{"user_id":{"$ref":"#/components/schemas/EnmasseUserId"},"timestamp":{"$ref":"#/components/schemas/EnmasseTimestamp"},"signature":{"$ref":"#/components/schemas/EnmasseSignature"},"access_token":{"$ref":"#/components/schemas/Token"},"refresh_token":{"$ref":"#/components/schemas/Token"},"device_id":{"$ref":"#/components/schemas/DeviceId"}}},"UserRank":{"type":"integer","nullable":true},"UserScore":{"type":"integer"},"UserRankAndScore":{"type":"object","properties":{"rank":{"$ref":"#/components/schemas/UserRank"},"score":{"$ref":"#/components/schemas/UserScore"}}},"LeaderboardItem":{"allOf":[{"$ref":"#/components/schemas/UserRankAndScore"},{"type":"object","properties":{"first_name":{"$ref":"#/components/schemas/UserFirstName"},"last_name":{"$ref":"#/components/schemas/UserLastName"},"city":{"$ref":"#/components/schemas/UserCity"},"region":{"$ref":"#/components/schemas/UserRegion"}}}]},"LeaderboardItemWithPublicId":{"allOf":[{"$ref":"#/components/schemas/LeaderboardItem"},{"type":"object","properties":{"public_id":{"$ref":"#/components/schemas/UserPublicId"}}}]},"LoginCredentials":{"type":"object","required":["email","password"],"properties":{"email":{"$ref":"#/components/schemas/Email"},"password":{"$ref":"#/components/schemas/Password"},"device_id":{"$ref":"#/components/schemas/DeviceId"}}},"SignCredentials":{"type":"object","required":["access_token","refresh_token"],"properties":{"access_token":{"$ref":"#/components/schemas/Token"},"refresh_token":{"$ref":"#/components/schemas/Token"},"device_id":{"$ref":"#/components/schemas/DeviceId"}}},"MysqlPing":{"type":"object","nullable":true},"RedisPing":{"type":"string","nullable":true},"ServerStatus":{"type":"object","properties":{"success":{"type":"boolean","description":"Overall result"},"master_mysql_ping":{"$ref":"#/components/schemas/MysqlPing"},"slave_mysql_ping":{"$ref":"#/components/schemas/MysqlPing"},"master_redis_ping":{"$ref":"#/components/schemas/RedisPing"},"slave_redis_ping":{"$ref":"#/components/schemas/RedisPing"},"date":{"type":"string","format":"date"},"timestamp":{"type":"integer","description":"Date in miliseconds"}}}},"requestBodies":{"LoginCredentials":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginCredentials"}}},"required":true},"UserPatch":{"content":{"application/json":{"schema":{"required":["access_token","refresh_token","region","city"],"allOf":[{"$ref":"#/components/schemas/SignCredentials"},{"type":"object","properties":{"region":{"$ref":"#/components/schemas/UserRegion"},"city":{"$ref":"#/components/schemas/UserCity"}}}]}}},"required":true},"SignCredentials":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignCredentials"}}},"required":true}},"responses":{"RegistrationDataAndProfile":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/RegistrationDataAndProfile"}}}}}},"Leaderboard":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/LeaderboardItem"},{"$ref":"#/components/schemas/LeaderboardItemWithPublicId"}]}}}}}}},"UserRankAndScore":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserRankAndScore"}}}}}},"ServerIsOk":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerStatus"}}}},"ServerIsIll":{"description":"Server is ILL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerStatus"}}}},"Spec":{"description":"success","content":{"text/yaml":{"schema":{"type":"string"}}}},"CustomBadRequest":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"code":{"type":"integer"},"data":{"type":"object","nullable":true},"message":{"type":"string"}}},"examples":{"invalidProjectUUID":{"value":{"code":10,"summary":"Invalid project uuid"}},"invalidPublicId":{"value":{"code":11,"summary":"Invalid user public id"}}}}}},"InvalidCredentials":{"description":"Invalid Credentials"},"TooManyConnections":{"description":"Too Many Connections"}}}}