Gamification API
| Endpoint | Method | Description |
|---|---|---|
| websocket | Gamification: add easter egg prop | |
| gamification:setEasterEggProp | websocket | Gamification: set easter egg prop |
| gamification:removeEasterEggProp | websocket | Gamification: remove easter egg prop |
| gamification:getEasterEggProps | websocket | Gamification: get easter egg props |
| gamification:tryDiscoverProp | websocket | Gamification: try discover prop |
| gamification:getRanking | websocket | Gamification: get ranking |
| gamification:deleteUserRanking | websocket | Gamification: delete user ranking |
| gamification:deleteAllRankings | websocket | Gamification: delete all rankings |
| gamification:points | websocketEvent | User points event |
| gamification:easterEggPropAdded | websocketEvent | On easter egg prop added event |
| gamification:easterEggPropRemoved | websocketEvent | On easter egg prop removed event |
Gamification: add easter egg prop
Method: websocket
Endpoint: gamification:addEasterEggProp
DEPRECATED
Request:
{
"data": {
"roomId": string
"propId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Gamification: set easter egg prop
Method: websocket
Endpoint: gamification:setEasterEggProp
Request:
{
"data": {
"roomId": string
"propId": string
"pointsPerAction": map[string]float
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Gamification: remove easter egg prop
Method: websocket
Endpoint: gamification:removeEasterEggProp
Request:
{
"data": {
"roomId": string
"propId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Gamification: get easter egg props
Method: websocket
Endpoint: gamification:getEasterEggProps
Request:
{
"data": {
"roomId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"propIds": [ string ] // deprecated
"props": [{
"roomId": string
"propId": string
"pointsPerAction": map[string]float
}]
}
"error": { "status": bool, "code": int, "message": string }
}
Gamification: try discover prop
Method: websocket
Endpoint: gamification:tryDiscoverProp
Request:
{
"data": {
"user": string
"roomId": string
"propId": string
"action": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"isFirstTimeDiscovered": bool
}
"error": { "status": bool, "code": int, "message": string }
}
Gamification: get ranking
Method: websocket
Endpoint: gamification:getRanking
Description: If own rank equals 0, it means that user is not participating in ranking because he doesn't have any points yet.
Request:
{
"data": {
"offset": int
"size": int
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"top": [{
"user": { user simple structure }
"rank": int
"points": float
}]
"own": {
"user": { user simple structure }
"rank": int
"points": float
}
"total": int
}
"error": { "status": bool, "code": int, "message": string }
}
Gamification: delete user ranking
Method: websocket
Endpoint: gamification:deleteUserRanking
Request:
{
"data": {
"userId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Gamification: delete all rankings
Method: websocket
Endpoint: gamification:deleteAllRankings
Request:
{ empty }
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
User points event
Event: gamification:points
Data:
{
"data": {
"points": float
}
"error": { "status": bool, "code": int, "message": string }
}
On easter egg prop added event
Event: gamification:easterEggPropAdded
Data:
{
"data": {
"roomId": string
"propId": string
"pointsPerAction": map[string]float
}
"error": { "status": bool, "code": int, "message": string }
}
On easter egg prop removed event
Event: gamification:easterEggPropRemoved
Data:
{
"data": {
"roomId": string
"propId": string
}
"error": { "status": bool, "code": int, "message": string }
}
Models
User Simple
{
"id": string
"firstName": string
"lastName": string
"privacyMode": int // 0 - Default, 1 - Incognito
"avatar": string
"avatar3D": { // field is not returned if empty
"assetId": string
"assetSkins": map[string]string // map of selected skins per variants
"avatarUrl": string // url to gbl file (Ready Player Me)
"avatarUserId": string // user id for session recovery (Ready Player Me)
}
"companyName": string // name of company that user represents
"companyTitle": string // user title in the company
}