The authorization is needed for the following actions:
- Changing member's profile or password
- Creating a new game board
- Joining a game board and performing actions like making moves or sending messages in a game chat.
The authorization procedure involves sending member's username and password to the igGameCenter API and receiving an XML response containing member's ID and a unique session ID. These IDs should be sent for performing all actions mentioned above.
For authorization an external application should send a POST request to the following API script:
http://www.iggamecenter.com/api_login.php
containing the following parameters:
Field Name |
Field Content |
app_id |
Application unique ID |
app_code |
Application secret passcode |
login |
Member's nickname or e-mail |
password |
Member's password (plain-text or MD5 hash) |
md5 |
0 - if the password field contains a plain-text password
1 - if the password field contains a calculated MD5 hash of the member's password |
networkuid |
[optional] [max 64 symbols] A unique id associated with the physical device / site / social network.
Sending this parameter allows igGameCenter to track the number of games played by the member via the application.
|
The returned response will be one of the following:
Success response:
<loginResult>
<uid>333</uid>
<name>ChessMaster</name>
<session_id>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</session_id>
</loginResult>
Failure response:
<errorMessage>--Some error message--</errorMessage>
where
Field Name |
Field Content |
uid |
Member's ID |
name |
Member's Nickname |
session_id |
Unique session ID |
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_EMAIL_NICK |
- invalid email or nickname specified |
USER_NOT_FOUND |
- member with the specified email or nickname was not found |
INVALID_PASSWORD |
- invalid password specified |
|
|