{"openapi":"3.0.3","info":{"title":"Breshna API Docs","description":"These are the basic API routes used to communicate with Breshna Games and Blitz SDK\n\n\nFollow these steps to setup an API Key and start creating your games with Blitz SDK\n\n1. You need to have a Breshna account to generate a new API Key. If you don't have an account, signup using `stg.breshna.io`\n2. Login to your account to get you JWT Bearer token\n3. Generate a new API Key and API secret with the Bearer Token and User ID from your login response\n4. Use the API Key to get suggestions for the type of assets and then using those asset name, create a game","contact":{"name":"Yasir Hassan","email":"yasir.hassan@stax3.com"},"version":"0.2.0"},"servers":[{"url":"https://stg.breshna.io/api","description":"Staging Server"}],"tags":[{"name":"Blitz","description":"Everything about Blitz SDK"},{"name":"Stats_Public_APIs","description":"Everything about Stats Public API"}],"paths":{"/users/login":{"post":{"tags":["Blitz"],"summary":"Login user based using email and password","description":"Login user based using email and password","operationId":"loginUser","requestBody":{"description":"Data for the user to login","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":404},"error":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/public_apps":{"post":{"tags":["Blitz"],"summary":"Get new API Key and Secret","description":"Generate a new API Key and Secret for accessing Blitz SDK","parameters":[{"name":"userid","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Data to generate a new API Key and Secret","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":200},"message":{"type":"string"},"data":{"type":"object","properties":{"name":{"type":"string"},"api_key":{"type":"string"},"api_secret":{"type":"string"},"user_id":{"type":"string"},"is_active":{"type":"boolean"},"_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"__v":{"type":"integer"}}}}}}}},"500":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":500},"message":{"type":"string"},"error":{"type":"string"}}}}}}},"security":[{"Bearer":[]}]}},"/assets/game-gen-search-public":{"get":{"tags":["Blitz"],"summary":"Find assets for a game corresponding to asset types","description":"Get an array of asset names for a given game and asset type. It requires Blitz API key to get all the asset names","parameters":[{"name":"game_type","in":"query","description":"Game names","required":true,"schema":{"type":"string","enum":["Rev and Ride","Runner Rave","Seek and Smash"]}},{"name":"asset_type","in":"query","description":"Asset Types","required":true,"schema":{"type":"string","enum":["avatar","background","collectibles","nonCollectibles","obstacles","laser","interface","platform"]}},{"name":"query","in":"query","description":"Query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":200},"data":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":404},"message":{"type":"string"}}}}}}},"security":[{"api_key":[]}]}},"/assets/game-gen-public":{"post":{"tags":["Blitz"],"summary":"Creates a new Game with predefined game template, title and type assets assigned","description":"Generate a new game with the Blitz SDK using predefined Assets and Game template","requestBody":{"description":"Data to generate a new Game using Blitz SDK","content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","example":"Blitz Public"},"game_type":{"type":"string","description":"Type of game template","example":"Seek and Smash","enum":["Rev and Ride","Runner Rave","Seek and Smash"]},"data":{"type":"object","properties":{"avatar":{"type":"object","description":"Avatar will show up as the main player","properties":{"count":{"type":"string","example":""},"keyword":{"type":"string","example":"space"}}},"background":{"type":"object","description":"The background for the generating game","properties":{"count":{"type":"string","example":""},"keyword":{"type":"string","example":"space"}}},"collectibles":{"type":"object","description":"These will be collected by the player, resulting in increasing the score","properties":{"count":{"type":"string","example":"5"},"keyword":{"type":"string","example":"moon"}}},"nonCollectibles":{"type":"object","description":"You need to avoid these","properties":{"count":{"type":"string","example":"5"},"keyword":{"type":"string","example":"sun"}}},"music":{"type":"object","description":"Music in the game","properties":{"count":{"type":"string","example":""},"keyword":{"type":"string","example":""}}},"laser":{"type":"object","description":"Laser will be available in Seek and Smash game","properties":{"count":{"type":"string","example":""},"keyword":{"type":"string","example":""}}},"interface":{"type":"object","properties":{"count":{"type":"string","example":""},"keyword":{"type":"string","example":""}}}}}}}}},"required":true},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"HTTP status code of the response","example":200},"message":{"type":"string","description":"A message providing additional information about the response"},"url":{"type":"string","description":"URL of the created game"}}}}}}},"security":[{"api_key":[]}]}},"/games_stats/public/stats":{"get":{"tags":["Stats_Public_API"],"summary":"Get the summary of stats of the user","description":"Get the object containing the summarized stats of the user.","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":200},"data":{"type":"object","properties":{"total_play_time":{"description":"Total play time of all your games","type":"integer"},"max_play_time":{"description":"Highest play time among all your games","type":"integer"},"players":{"description":"Total number of players of all your games","type":"integer"},"plays":{"description":"Total number of times your games have been played","type":"integer"},"total_games":{"description":"Total number of games","type":"integer"}}}}}}}},"500":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":500},"message":{"type":"string"},"error":{"type":"string"}}}}}}},"security":[{"Bearer":[]}]}},"/games_stat/public/list":{"get":{"tags":["Stats_Public_API"],"summary":"Get the list of all the games your created","description":"Get the top level information about all the games you have created.","responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":200},"totalCount":{"type":"integer","example":20},"data":{"type":"array","items":{"type":"object","properties":{"game_name":{"type":"string"},"poster":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"category":{"type":"string"},"game_type":{"type":"string"}}}}}}}}},"400":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":500},"message":{"type":"string"},"error":{"type":"string"}}}}}}},"security":[{"Bearer":[]}]}},"/games_stat/public/stats/{game_id}":{"get":{"tags":["Stats_Public_API"],"summary":"Find detailed stats for a specific game","description":"","parameters":[{"name":"game_id","in":"query","description":"Provide it as url parameter to get stats for a specific game","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":200},"data":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"object","properties":{"play_id":{"type":"string"},"game_id":{"type":"string"},"user":{"type":"string"}}},"levels":{"type":"array","items":{"type":"object","properties":{"level_id":{"type":"integer"},"low_score":{"type":"integer"},"avg_score":{"type":"integer"},"high_score":{"type":"integer"},"total_time":{"type":"integer"},"max_time":{"type":"integer"},"avg_time":{"type":"integer"},"attempts":{"type":"integer"}}}},"updatedAt":{"type":"string"},"user":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"__v":{"type":"string"}}},"highest_score":{"type":"integer"},"lowest_score":{"type":"integer"},"total_play_time":{"type":"integer"},"max_play_time":{"type":"integer"},"total_avg_score":{"type":"integer"}}}},"totalCount":{"type":"integer","example":10},"high_score":{"type":"integer","example":5000},"avg_score":{"type":"integer","example":2500},"low_score":{"type":"integer","example":1000},"total_play_time":{"type":"integer","example":3600},"game":{"type":"object","properties":{"game_name":{"type":"string"},"poster":{"type":"string"},"createdAt":{"type":"string"},"id":{"type":"string"},"category":{"type":"string"},"game_type":{"type":"string"}}},"totalLevels":{"type":"integer","example":5},"createdAt":{"type":"string"}}}}}},"400":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","example":404},"message":{"type":"string"}}}}}}},"security":[{"Bearer":[]}]}}},"components":{"schemas":{"User":{"type":"object","properties":{"email":{"type":"string","example":"john@email.com"},"password":{"type":"string","example":"12345"},"type":{"type":"string","example":"user"}}},"ApiResponse":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"}}},"LoginResponse":{"type":"object","properties":{"status":{"type":"integer","example":200},"data":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"password":{"type":"boolean"},"type":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string"},"status":{"type":"string"},"coins":{"type":"integer"},"user_plots":{"type":"array","items":{"type":"string"}},"is_premium":{"type":"boolean"},"user_assets":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"token":{"type":"string"}}}}}},"requestBodies":{},"securitySchemes":{"api_key":{"type":"apiKey","name":"x-api-key","in":"header"},"Bearer":{"type":"apiKey","name":"Authorization","in":"header","description":"Enter the token with the `Bearer `"}}}}