User Locator API
| Endpoint | Method | Description |
|---|---|---|
| social:getUserLocator | websocket | Get user locator |
| social:getOnlineStatusesForUsers | websocket | Get online statuses for users |
| social:updateLocatorPlayground | websocket | Update locator playground |
| websocketEvent | Send friends locator event | |
| websocketEvent | Send locator updated event |
Get user locator
Method: websocket
Endpoint: social:getUserLocator
Request:
{
"data": {
"userId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"userId": string
"roomId": string
"playgroundId": string
"isOnline": bool
}
"error": { "status": bool, "code": int, "message": string }
}
Get online statuses for users
Method: websocket
Endpoint: social:getOnlineStatusesForUsers
Request:
{
"data": {
"userIds": [ string ]
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"statuses": map[string]bool
}
"error": { "status": bool, "code": int, "message": string }
}
Update locator playground
Method: websocket
Endpoint: social:updateLocatorPlayground
Request:
{
"data": {
"playgroundId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Send friends locator event
Event: social:friendsLocator
DEPRECATED
Description: Event sends to user information about his friends: if they are online and where are they located
Data:
{
"data": {
"friends": [{
"userId": string
"state": string // online/offline
"location": {
"place": string // lobby/room
"placeId": string // roomId in case when place == room
}
}]
}
"error": { "status": bool, "code": int, "message": string }
}
Send locator updated event
Event: social:locatorUpdated
DEPRECATED
Description: Event send information about updated user locator to his friends
Data:
{
"data": {
"friend": {
"userId": string
"state": string // online/offline
"location": {
"place": string // lobby/room
"placeId": string // roomId in case when place == room
}
}
}
"error": { "status": bool, "code": int, "message": string }
}