POST api/Game
Use this method to create a game
Request Information
URI Parameters
None.
Body Parameters
Holds all of the information to create a game.
CreateGameRequestName | Description | Type | Additional information |
---|---|---|---|
ShowPublic |
Use true if you want a public game, false if you want a private game. Defaults to true if not provided. |
boolean |
Required |
Name |
Name of the game to be displayed in the list |
string |
Required |
Code |
Code for the game. If not provided it will randomly be created. |
string |
None. |
Request Formats
application/json, text/json
Sample:
{ "showPublic": true, "name": "sample string 2", "code": "sample string 3" }
application/xml, text/xml
Sample:
<CreateGameRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TScunts.Models.API.MClone"> <Code>sample string 3</Code> <Name>sample string 2</Name> <ShowPublic>true</ShowPublic> </CreateGameRequest>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
The response to the create game request
CreateGameResponseName | Description | Type | Additional information |
---|---|---|---|
GameId |
The Id of the game created if it's created. |
integer |
Required |
Success |
True if successfully created the game. |
boolean |
Required |
ErrorMessage |
Error message if the request is unsuccessful. |
string |
Required |
Code |
Code for the game. |
string |
Required |
Response Formats
application/json, text/json
Sample:
{ "gameId": 1, "success": true, "errorMessage": "sample string 3", "code": "sample string 4" }
application/xml, text/xml
Sample:
<CreateGameResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TScunts.Models.API.MClone"> <Code>sample string 4</Code> <ErrorMessage>sample string 3</ErrorMessage> <GameId>1</GameId> <Success>true</Success> </CreateGameResponse>