igGameCenter API Developer Guide >> Joining a random game board
Joining a random 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 found game board. In the case no appropriate board can be found, a new board will be created.

For joining a random board an external application should send a POST request to the following API script:
http://www.iggamecenter.com/api_board_random.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. (for a list of all currently available games refer to this page) mandatory, numeric
place The desired place in a game (1,2 etc). optional, numeric
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 the application will look for "hidden" boards only so it won't connect to the boards, which are opened through the site.