Skip to content
On this page

Resource Reaction API

EndpointMethodDescription
resource:setReactionwebsocketSet resource reaction
resource:deleteReactionwebsocketDelete resource reaction
resource:getReactionswebsocketGet reactions for resource
resource:getUserOwnReactionwebsocketGet user own reaction for resource
resource:reactionUpdatedwebsocketEventOn resource reaction updated in room event
resource:reactionDeletedwebsocketEventOn resource reaction deleted in room event

Set resource reaction

Method: websocket

Endpoint: resource:setReaction

Request:

{
    "data": {
        "resource": string
        "comment": string
        "room": string
        "reaction": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

Delete resource reaction

Method: websocket

Endpoint: resource:deleteReaction

Request:

{
    "data": {
        "resource": string
        "comment": string
        "room": string
        "reaction": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

Get reactions for resource

Method: websocket

Endpoint: resource:getReactions

Request:

{
    "data": {
        "resourceId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": { user reactions structure }
    "error": { "status": bool, "code": int, "message": string }
}

Get user own reaction for resource

Method: websocket

Endpoint: resource:getUserOwnReaction

Request:

{
    "data": {
        "resourceId": string
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "ownReaction": string  // current user own reaction
    }
    "error": { "status": bool, "code": int, "message": string }
}

On resource reaction updated in room event

Event: resource:reactionUpdated

Data:

{
    "data": {
        "room": string
        "resource": string
        "reaction": {
            "updated": timestamp
            "reaction": string
            "fromUser": { user simple structure }
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

On resource reaction deleted in room event

Event: resource:reactionDeleted

Data:

{
    "data": {
        "room": string
        "resource": string
        "reaction": {
            "updated": timestamp
            "reaction": string
            "fromUser": { user simple structure }
        }
    }
    "error": { "status": bool, "code": int, "message": string }
}

Models


User Reactions

{
    "reactions": [ [ userId, reaction ] ]  // list of tuples [userId, reaction]
    "total": int  // total reactions for item
    "ownReaction": string  // current user own reaction
}

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
}