The pseudo-code below is a hypothetical use case of creating a new tournament, adding a prize, and registering a player. Most of the values are hard-coded,as it's just for illustration. Imagine that Duels is a class with various static methods that does the actual Rest API calls – those are not shown for brevity.
void main() { // Add a prize; create a new tournament; and register a new player AddPrize(); CreateTournament(); CreatePlayer(); } void AddPrize() { Prize prize = new Prize(); prize.Title = "Bragging Rights"; prize.Description = "Some very cool bragging rights"; prize.PrizeInfo = "PRIZE_BRAG_RIGHTS"; prize.ImageUrl = "https://s3.amazonaws.com/tournament-prizes/Prize-Item-1.png"; Duels.AddPrizeList(prize); } void CreateTournament() { Tournament t = new Tournament(); t.Title = "Awesome Tournament"; t.Subtitle = "Come Get Some"; t.Description = "The Greatest Tournament Ever"; t.ImageUrl = "https://amazon.com/image.png"; t.DateStart = DateTime.ToMillis(DateTime.Today); t.DateEnd = DateTime.ToMillis(DateTime.Today.AddDays(3)); t.MatchesMax = 1; t.MatchesPerPlayer = 1; t.PlayerAttemptsPerMatch = 100; t.PlayersPerMatch = 500; // Add a couple of entry and visibility requirements t.EntryRequirements.Add("99208d38-cac9-45fe-8bfd-954ff7e3ae11"); t.EntryRequirements.Add("35831019-b1d7-461a-9af9-22aa4abff68f"); t.VisibilityRequirements.Add("99208d38-cac9-45fe-8bfd-954ff7e3ae11"); t.VisibilityRequirements.Add("35831019-b1d7-461a-9af9-22aa4abff68f"); t.GenerateAccessKey = true; // Add a few prize bundles PrizeBundle prizeBundle1 = new PrizeBundle(); PrizeBundle prizeBundle2 = new PrizeBundle(); prizeBundle1.Title = "First Right"; prizeBundle1.Description = "First Bragging Rights"; prizeBundle1.ImageUrl = "https://s3.amazonaws.com/tournament-prizes/Prize-Item-1.png"; prizeBundle1.PrizeIds.Add("0031dc56-43e5-440f-9e05-ca747c28150e"); prizeBundle1.PrizeIds.Add("a6c0bc2a-d04f-449b-aa11-326072610592"); prizeBundle1.RankFrom = 1; prizeBundle1.RankTo = 3; prizeBundle2.Title = "Second Right"; prizeBundle2.Description = "Second Bragging Rights"; prizeBundle2.ImageUrl = "https://s3.amazonaws.com/tournament-prizes/Prize-Item-2.png"; prizeBundle2.PrizeIds.Add("a6c0bc2a-d04f-449b-aa11-326072610592"); prizeBundle2.RankFrom = 4; prizeBundle2.RankTo = 10; t.PrizeBundles.Add(prizeBundle1); t.Prizebundles.Add(prizebundle2); t.ScoreType = TOURNAMENT_SCORE_TYPES.INDIVIDUAL; t.WinType = TOURNAMENT_WIN_TYPES.HIGHEST; t.Metadata = "Stage:5, Difficulty:9"; Duels.AddTournament(t); } void CreatePlayer() { Player player = new Player(); player.AdvertisingId = "54d8fd8d-e349-49d8-902c-0558365ac22b"; player.EncryptedPayload = R.GetEncryptedPayload(); Duels.RegisterPlayer(player); }