Playground API
| Endpoint | Method | Description |
|---|---|---|
| playground:getUserGroups | websocket | Playground: get user groups |
| playground:createGroup | websocket | Playground: create group |
| playground:updateGroup | websocket | Playground: update group |
| playground:deleteGroup | websocket | Playground: delete group |
| playground:addGroupParticipant | websocket | Playground: add group participant |
| playground:deleteGroupParticipant | websocket | Playground: delete group participant |
| playground:refreshGroupInviteData | websocket | Playground: refresh group invite data |
| playground:groupCreated | websocketEvent | Playground group created event |
| playground:groupUpdated | websocketEvent | Playground group updated event |
| playground:groupDeleted | websocketEvent | Playground group deleted event |
| playground:groupParticipantAdded | websocketEvent | Playground group participant added event |
| playground:groupParticipantDeleted | websocketEvent | Playground group participant deleted event |
Playground: get user groups
Method: websocket
Endpoint: playground:getUserGroups
Description: Endpoint returns list of user playground groups.
Request:
{
"data": {
"roomId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"groups": [{
"id": string
"name": string
"groupType": uint32
"inviteCode": string
"inviteLink": string
"roomId": string
"ownerId": string // user id of owner
"participants": [{
"userId": string
"role": int // 0 - Participant, 1 - Owner
}]
}]
}
"error": { "status": bool, "code": int, "message": string }
}
Playground: create group
Method: websocket
Endpoint: playground:createGroup
Request:
{
"data": {
"roomId": string
"description": {
"name": string
"groupType": uint32
}
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"group": {
"id": string
"name": string
"groupType": uint32
"inviteCode": string
"inviteLink": string
"roomId": string
"ownerId": string // user id of owner
"participants": [{
"userId": string
"role": int // 0 - Participant, 1 - Owner
}]
}
}
"error": { "status": bool, "code": int, "message": string }
}
Playground: update group
Method: websocket
Endpoint: playground:updateGroup
Request:
{
"data": {
"groupId": string
"description": {
"name": string
"groupType": uint32
}
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Playground: delete group
Method: websocket
Endpoint: playground:deleteGroup
Request:
{
"data": {
"groupId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Playground: add group participant
Method: websocket
Endpoint: playground:addGroupParticipant
Request:
{
"data": {
"groupId": string
"participant": {
"userId": string
"role": int // 0 - Participant, 1 - Owner
}
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Playground: delete group participant
Method: websocket
Endpoint: playground:deleteGroupParticipant
Request:
{
"data": {
"groupId": string
"participantId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"error": { "status": bool, "code": int, "message": string }
}
Playground: refresh group invite data
Method: websocket
Endpoint: playground:refreshGroupInviteData
Description: Endpoint generates new inviteCode and inviteLink for a playground group.
Request:
{
"data": {
"groupId": string
}
"event": { "id": string, "date": timestamp }
}
Response:
{
"data": {
"inviteCode": string
"inviteLink": string
}
"error": { "status": bool, "code": int, "message": string }
}
Playground group created event
Event: playground:groupCreated
Data:
{
"data": {
"group": {
"id": string
"name": string
"groupType": uint32
"inviteCode": string
"inviteLink": string
"roomId": string
"ownerId": string // user id of owner
"participants": [{
"userId": string
"role": int // 0 - Participant, 1 - Owner
}]
}
}
"error": { "status": bool, "code": int, "message": string }
}
Playground group updated event
Event: playground:groupUpdated
Data:
{
"data": {
"groupId": string
"description": {
"name": string
"groupType": uint32
}
}
"error": { "status": bool, "code": int, "message": string }
}
Playground group deleted event
Event: playground:groupDeleted
Data:
{
"data": {
"groupId": string
}
"error": { "status": bool, "code": int, "message": string }
}
Playground group participant added event
Event: playground:groupParticipantAdded
Data:
{
"data": {
"groupId": string
"participant": {
"userId": string
"role": int // 0 - Participant, 1 - Owner
}
}
"error": { "status": bool, "code": int, "message": string }
}
Playground group participant deleted event
Event: playground:groupParticipantDeleted
Data:
{
"data": {
"groupId": string
"participant": {
"userId": string
"role": int // 0 - Participant, 1 - Owner
}
}
"error": { "status": bool, "code": int, "message": string }
}