-
Notifications
You must be signed in to change notification settings - Fork 0
rest service api
detsam edited this page Nov 30, 2012
·
14 revisions
URI | http://{host:port/{context_name}}/game/{gameId}/match | ||||||||||
Method | PUT | ||||||||||
Path variables | gameId | Game hub UUID unique for every hub. | |||||||||
Request Body | multipart/form-data | ||||||||||
Form | accountName | User account name string. | |||||||||
Returns |
|
||||||||||
401 Unauthorized | In case where accountName invalid, inactive, etc. | ||||||||||
404 Not Found |
URI | http://{host:port/{context_name}}/game/{gameId}/match/{matchId}/result | ||
Method | POST | ||
Path variables | |||
gameId | Game hub UUID unique for every hub. | ||
matchId | Game match UUID unique for every match. | ||
Request Body | multipart/form-data | ||
Form | |||
accountName | User account name, not empty string. | ||
ricoshetsCount | Ball ricoshets count, must be a positive or zero integer. | ||
winnerName | Match winner name, must be a not empty string. | ||
maxBallSpeed | Ball max speed in game, must be a positive integer. | ||
Returns | 200 OK & empty body | ||
401 Unauthorized | In case where accountName invalid, inactive, etc. | ||
404 Not Found |
URI | http://{host:port/{context_name}}/statistic/{accountName} | ||||||||||
Method | GET | ||||||||||
Path variables | |||||||||||
accountName | Account name for statistic query. | ||||||||||
Returns |
|
||||||||||
401 Unauthorized | In case where accountName invalid, inactive, etc. | ||||||||||
404 Not Found |
1 Step: PUT /game/15432/match accountName=PingPongGod
First, we create a new game match on the 15432 hub, parse the response and take matchId af1234ba.
2 Step: POST /game/15432/match/af1234ba/result accountName=PingPongGod&winner=PingPongGod&[etc.]
After match ends we POST result of the match by match id and hub id.
3 Step: GET /statistic/PingPongGod
After all we can fetch account statistic by account name.