User Avatar Management
Player’s avatar setup
Request URL
POST http(s)://API_URL/v2/app/users/:userId/avatar?clientId=[CLIENT_ID]
Request header (HTTP Header)
| Parameter Name | Description | Optional / Mandatory | 
|---|---|---|
| sign | Request signature | Mandatory | 
Request parameters
| Parameter Name | Description | Optional / Mandatory | 
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory | 
| userId | User identifier | Mandatory | 
| avatar | Avatar file. The file size should not exceed 20Mb. | Optional | 
| avatarUrl | Link to the player’s avatar for upload | Optional | 
Response parameters
If the value of avatarUrl parameter was sent, the avatar must be uploaded using this URL; otherwise, the avatar will be uploaded from the file sent in the avatar parameter.
| Parameter Name | Description | Optional / Mandatory | 
|---|---|---|
| name | Avatar URL | Mandatory | 
| type | mime type of avatar file | Mandatory | 
| size | File size | Mandatory | 
Errors returned
| HTTP Code | Message | Description | 
|---|---|---|
| 400 | Not valid request | Incorrect request signature | 
| 404 | Player not found | User with userId sent was not found | 
| 422 | Avatar and avatarUrl cannot be blank | At least one of the following parameters must be sent: avatar or avatarUrl | 
| Only files with these extensions are allowed: png, jpg | File format is not supported for upload | |
| By URL is not a image | The file sent as avatarUrl is not an image file | |
| URL not available | The avatarUrl sent is not available | |
| 413 | Request Entity Too Large | The maximum file size is exceeded | 
Example of response
{
	"data": {
	"id": "123456",
	"type": "avatar",
	"attributes": {
		"name": "/avatars/123456.png",
		"type": "image/png",
		"size": 169976
	}
	}
}