Operators should send the error response in the following format and data:
Error Response + Example
{
'status': 1,
'error_id': 101,
'error_code': 'INVALID_TOKEN',
'error_message': "Invalid Token"
}
Object/Key in Response Object | Type | Description |
---|---|---|
status | Integer | 1 Indicates FAIL, 0 indicates SUCCESS, |
error_id | Integer | Error ID |
error_code | Integer | Error code |
error_message | String | Optional. Human readable error message |
List of common errors codes and messages for all POST parameters
Below are common error codes for POST parameters. These will validate if any required POST parameter is missing, if it is null, length and size of the parameters etc. Same error code can be used for more than one POST parameter.
ID | Code | Message |
---|---|---|
2001 | INVALID_%field_name% | %field_name% is required. |
2002 | INVALID_%field_name% | %field_name% should not be null. |
2003 | INVALID_%field_name% | %field_name% should not be blank. |
2004 | INVALID_%field_name% | %field_name% should be at least %error_value% characters long. |
2005 | INVALID_%field_name% | %field_name% should not be more than %error_value% characters |
2006 | INVALID_%field_name% | String is invalid. |
2007 | INVALID_%field_name% | Email is invalid. |
2008 | INVALID_%field_name% | A valid integer is required. |
2009 | INVALID_%field_name% | The value should be equal or less than %error_value%. |
2010 | INVALID_%field_name% | The value should be equal or more than %error_value%. |
2011 | INVALID_%field_name% | Too large string value. |
In the above table “%field_name%” can be any expected parameter that must be sent in the POST data. For example, let us take below POST data.
{
"api_key": "1pghjl4v5apt2bks",
"username": "test_user",
"password": "test1234",
"transaction_id": 1234
}
In this case, API caller is not sending the ‘transaction_id’ in POST data, RGS API would send an error message to the caller in the following format that is internal to game provider (Game Engine + RGS):
{
"error": 1,
"error_detail": {
"id": 2001,
"code": "INVALID_TRANSACTION_ID",
"message": "Transactionid is required."
}
}
Object/Key in Response Object | Type | Description |
---|---|---|
error | Integer | 1 Indicates ERROR, 0 indicates NO ERROR, |
error_detail | JSON Object | It has 3 keys id |
id | Integer | Error ID |
code | String | Error code |
message | String | Optional. Human readable error message |
error ‘code’ would be ‘INVALID_’ followed by missing parameter name in capitals i.e. ‘INVALID_TRANSACTION_ID’ and ‘message’ would be ‘parameter name without underscore, words separated by space’ and followed by ‘is required.’ i.e. ‘Transaction id is required’.
When ‘transaction_id’ parameter is missing in POST Data
ID | Code | Message |
---|---|---|
2001 | INVALID_%field_name% will be interpreted as INVALID_TRANSACTION_ID | “%field_name% is required.” will be interpreted as “Transaction id is required.” |
2002 | INVALID_%field_name% will be interpreted as INVALID_TRANSACTION_ID | “%field_name% should not be null.” will be interpreted as “Transaction id should not be null.” |
2003 | INVALID_%field_name% will be interpreted as INVALID_TRANSACTION_ID | “%field_name% should not be blank.” will be interpreted as “Transaction id should not be blank.” |
Same is the case with all the POST parameters that fall into the above validation criteria from id 2001 to 2011.
List of Error codes and messages (Excluding common code and message)
ID | Code | Message |
---|---|---|
2012 | INVALID_LOGIN_CREDENTIALS | Unable to login with credentials provided. |
2013 | INVALID_LOGIN_CREDENTIALS | Must include username and password. |
2014 | INVALID_LOGIN_CREDENTIALS | User does not belong to this website. |
2015 | INVALID_API_KEY | API Key is invalid |
2016 | INVALID_SESSION_ID | Invalid session ID |
2017 | INVALID_PROVIDER | Invalid provider |
2018 | INVALID_GAME_TYPE | Invalid game type |
2019 | INVALID_PLATFORM | Invalid platform |
2020 | INVALID_AMOUNT_TYPE | Invalid amount type |
2021 | INVALID_PLAYER_ID | Invalid player ID |
2022 | INVALID_GAME_ID | Invalid game ID. |
2023 | INVALID_LANGUAGE | Invalid language. |
2024 | INVALID_USERNAME | Invalid username. |
2025 | CURRENT_NEW_PASSWORD_SAME | Current & new password should not be same. |
2026 | INVALID_CURRENCY | Invalid currency. |
2027 | NEGATIVE_AMOUNT_VALUE | Amount should be positive value. |
2028 | INSUFFICINT_BALANCE | Insufficient balance. |
2029 | INVALID_STARTDATE_ENDDATE | Start date should not be greater than end date. |
2030 | INVALID_AMOUNT_VALUE | Amount should be less than balance. |
2031 | DUPLICATE_SESSION_ID | Duplicate session ID. |
2032 | OPERATOR_AUTHENTICATION_FAIL | Authentication with operator failed. |
2033 | CURRENCY_MISMATCH | Player currency mismatch between operator and opus |
2034 | ZERO_AMOUNT_VALUE | Amount should be more than zero. |
2035 | FALIED_TRANS | Transaction not found or failed. |
2036 | INVALID_FROM_DATE | From date is greater than to date. |
2037 | INVALID_TIME_INTERVAL | Time interval is more than the allowed one. |
2038 | INVALID_MONETARY_TYPE | Invalid monetary type. |
2040 | INVALID_TRANSACTION_TYPE | Invalid transaction type |
2062 | DUPLICATE_USERNAME | Duplicate username |