Creating a new game board involves sending a request to the igGameCenter API with several required parameters and receiving an XML response containing new game board session's ID and an address of a server that will handle all events in the created game board.
For creating a new board an external application should send a POST request to the following API script:
http://www.iggamecenter.com/api_board_create.php
containing the following parameters:
Field Name |
Field Content |
Field Format |
app_id |
Application unique ID |
mandatory, numeric |
app_code |
Application secret passcode |
mandatory, alpha-numeric |
uid |
Member's ID that was received during authorization procedure) |
mandatory, numeric |
session_id |
Unique session ID that was received during authorization procedure) |
mandatory, alpha-numeric |
gid |
ID of a game that will be played on the new board. |
mandatory, numeric |
place |
the desired place to take on the new board. |
optional, numeric (1-4) |
The returned response will be one of the following:
Success response:
<sessionInfo>
<sid>1573</sid>
<server>gc1</server>
</sessionInfo>
Failure response:
<errorMessage>--Some error message--</errorMessage>
where
Field Name |
Field Content |
sid |
Unique session ID for the new board. This ID has to be passed in all further requests for performing actions in the corresponding board. |
server |
Subdomain prefix of the server handling this board. I.e. if this parameter equals to gc1 then you have to refer all your further requests to the server gc1.iggamecenter.com for performing actions in the corresponding board (join it, send chat message, make move, etc). |
errorMessage |
Could be one of the following error messages:
DATABASE_ERROR |
- some fatal error occured while accessing DB |
INVALID_APP_ID |
- invalid application ID specified |
INVALID_APP_CODE |
- invalid application passcode specified |
INVALID_GAME_ID |
- invalid game ID specified |
GAME_NOT_FOUND |
- game with specified ID is not found |
SHOULD_BE_AUTH_ERROR |
- invalid authorization information specified (either uid or session_id) |
|
Important remark #1: if a status of the application is "DEVELOPMENT" then all created game boards will be hidden by default (i.e. they will not be present in a public board list).
Important remark #2: your should send JOIN command to igGameCenter API handler script within no more than 30 seconds after creating the board. Otherwise, the board will be automaticly deleted. |