Validate Code
Endpoint that is used to validate code from player, part of the verification of the player. Please not, we are executing login if 2fa was successfully validated, response within the ‘data’ section will contain same response as we currently have in login method (on success with additional fields), all additional validations that needs to be done (i.e TNC_REQUIRED) will be returned in the 422 error code under data section, with player token as well, can be used
Request (PUT)
/gateway/player-data/{version}/validate/code/{brand_id}
Parameters:
{
"sms_code": "123456"
}| Name | In | Type | Required | Description |
|---|---|---|---|---|
| version | path | string | true | The API version to use. |
| brand_id | path | int | true | The ID of the casino. If a brand_id is not provided, all message formats will be fetched from default storage. |
| x-auth-token | header | string | true | Player login session. |
| 2fa-auth-token | header | string | true | 2fa auth token, which will be saved in browser. |
| sms_code | body | string | true | received code from player. |
Response
Status 200
200 Response
{
"status": "Success",
"data": {
"description": "Valid",
"2fa_auth_token": "c8bfd06c-f934-4cb9-a554-694825b89328",
"updated_fields": {
"mobile_number": "44-12456789",
"verification_status": "1"
},
"result": "OK",
"token": "8e62cc96-a21f-11ed-be7e-b289e620c23d",
"auth_token": "8e62cc96-a21f-11ed-be7e-b289e620c23d",
"status": 200
}
}Status 400
{
"errMsg": "invalid input - invalid brand id"
}Status 401
{
"errMsg": "invalid input - invalid token"
}If you receive a 422 error code for an Unprocessable Entity error, the client should not use the Message Format method to send a request to the server, but use its internal logic to present the message for one or more fields that didn’t pass the validation.
When a 422 validation error occurs, the response returns an array of one or more error codes detailing the fields that have validation errors. Multiple error messages are issued in the same validation form. The site should handle these validation errors and present a validation message to the player.
This will not call the message format.
The following table explains validation code behavior:
| Field | Description |
|---|---|
| 2fa-auth-token | Auth Token is already verified |
| 2fa-auth-token | Auth token does not exist |
{
"status": "Error",
"data": {
"description": "Please wait before sending again in 50 seconds",
"2fa_auth_token": "c8bfd06c-f934-4cb9-a554-694825b89328"
}
}Status 500
{
"result": "internal server error"
}