Skip to content

Latest commit

 

History

History
126 lines (88 loc) · 1.96 KB

API_Docu.md

File metadata and controls

126 lines (88 loc) · 1.96 KB

Tele-Schocken API Dokumentationen

Summery

* GET	/api/game/<gid> 	    			Return the State of the Game (Polling)
* POST	/api/game							Add a new Game.
* POST	/api/game/<gid>/user/				Add a new User to a Game.
* GET	/api/game/<gid>/user/<uid>/dice 	Roll a given number of dice  
* POST	/api/game/<gid>/user/<uid>/finisch 	finisch throwing dice (bevor 3)      
* POST	/api/game/<gid>/chips				move chips from user to user or
 											stack to user
* POST	/api/game/<gid>/start				Start the Game

GET /api/game/

HTTP/1.1 200 OK
Content-Type: text/json

Move an Game ?? move : Hans bzw ID???

"Stack" : 10,
"State" : "String",
"First_Half" : true,
"Move" : "Userid",
"First" : "Userid",
"Admin" : "Userid",
"Users": [{
	"Id" : 11,
	"Name"  : "Hans",
	"Chips" : 2,
	"Passive" : false,
	"Visible" : false
	},
	{
	"Id" : 11,
	"Name"  : "Hans",
	"Chips" : 2,
	"Passive" : false,
	"Visible" : false
	}
]

Error Response:

POST /api/game

given:

{'name': 'Tim123'}

response:

HTTP/1.1 200 OK
Content-Type: text/json
"Link" : "tele-schocken.de/abc123",
"UUID": "abc123"

POST /api/game//user/

{'name': 'Tim123'}

POST /api/game//user//dice

"dice1" : true,
"dice2" : true,
"dice3" : false,
HTTP/1.1 200 OK
Content-Type: text/json
"fallen" : true,
"dice1" : 2, (Optional)
"dice2" : 3, (Optional)
"dice3" : 6, (Optional)

POST /api/game//user//diceturn

"count" : 1 (Allowed Values 1,2)
HTTP/1.1 200 OK
Content-Type: text/json
"dice1" : 2, (Optional)
"dice2" : 3, (Optional)
"dice3" : 6, (Optional)

POST /api/game//chips

"count" : 3,
"stack" : true, (Optional)
"source" : <userid>, (Optional)
"target" : <userid>
HTTP/1.1 200 OK
Content-Type: text/json

Tele-Schocken Routs

Summery

* GET	/game/<gid> 	    			View play game
* GET	/game							View Create new Game