Skip to content
On this page

Playground API

EndpointMethodDescription
playground:getUserGroupswebsocketPlayground: get user groups
playground:createGroupwebsocketPlayground: create group
playground:updateGroupwebsocketPlayground: update group
playground:deleteGroupwebsocketPlayground: delete group
playground:addGroupParticipantwebsocketPlayground: add group participant
playground:deleteGroupParticipantwebsocketPlayground: delete group participant
playground:refreshGroupInviteDatawebsocketPlayground: refresh group invite data
playground:groupCreatedwebsocketEventPlayground group created event
playground:groupUpdatedwebsocketEventPlayground group updated event
playground:groupDeletedwebsocketEventPlayground group deleted event
playground:groupParticipantAddedwebsocketEventPlayground group participant added event
playground:groupParticipantDeletedwebsocketEventPlayground 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 }
}